Multiple AVWAP [OmegaTools]The Multiple AVWAP indicator is a sophisticated trading tool designed for professional traders who require precision in volume-weighted price tracking. This indicator allows for the deployment of multiple Anchored Volume Weighted Average Price (AVWAP) calculations simultaneously, offering deep insights into price movements, dynamic support and resistance levels, and trend structures across multiple timeframes.
This indicator caters to both institutional and retail traders by integrating flexible anchoring methods, multi-timeframe adaptability, and enhanced visualization features. It also includes deviation bands for statistical analysis, making it a comprehensive volume-based trading solution.
Key Features & Functionalities
1. Multiple AVWAP Configurations
Users can configure up to four distinct AVWAP calculations to track different market conditions.
Supports various anchoring methods:
Fixed: A traditional AVWAP that starts from a defined historical point.
Perpetual: A rolling VWAP that continuously adjusts over time.
Extension: An extension-based AVWAP that projects from past calculations.
High Volume: Anchors AVWAP to the highest volume bar within a specified period.
None: Option to disable AVWAP calculation if not required.
2. Advanced Deviation Bands
Implements standard deviation bands (1st and 2nd deviation) to provide a statistical measure of price dispersion from the AVWAP.
Serves as a dynamic method for identifying overbought and oversold conditions relative to VWAP pricing.
Deviation bands are customizable in terms of visibility, color, and transparency.
3. Multi-Timeframe Support
Users can assign different timeframes to each AVWAP calculation for macro and micro analysis.
Helps in identifying long-term institutional trading levels alongside short-term intraday trends.
4. Z-Score Normalization Mode
Option to standardize oscillator values based on AVWAP deviations.
Converts price movements into a statistical Z-score, allowing traders to measure price strength in a normalized range.
Helps in detecting extreme price dislocations and mean-reversion opportunities.
5. Customizable Visual & Aesthetic Settings
Fully customizable line colors, transparency, and thickness to enhance clarity.
Users can modify AVWAP and deviation band colors to distinguish between different levels.
Configurable display options to match personal trading preferences.
6. Oscillator Mode for Trend & Momentum Analysis
The indicator converts price deviations into an oscillator format, displaying AVWAP strength and weakness dynamically.
This provides traders with a momentum-based perspective on volume-weighted price movements.
User Guide & Implementation
1. Configuring AVWAPs for Optimal Use
Choose the mode for each AVWAP instance:
Fixed (set historical point)
Perpetual (rolling, continuously updated AVWAP)
Extension (projection from past AVWAP levels)
High Volume (anchored to highest volume bar)
None (disables the AVWAP line)
Adjust the length settings to fine-tune calculation sensitivity.
2. Utilizing Deviation Bands for Market Context
Activate deviation bands to see statistical boundaries of price action.
Monitor +1 / -1 and +2 / -2 standard deviation levels for extended price movements.
Consider price action outside of deviation bands as potential mean-reversion signals.
3. Multi-Timeframe Analysis for Institutional-Level Insights
Assign different timeframes to each AVWAP to compare:
Daily VWAP (institutional trading levels)
Weekly VWAP (swing trading trends)
Intraday VWAPs (short-term momentum shifts)
Helps identify where institutional liquidity is positioned relative to price.
4. Activating the Oscillator for Momentum & Bias Confirmation
The oscillator converts AVWAP deviations into a normalized value.
Use overbought/oversold levels to determine strength and potential reversals.
Combine with other indicators (RSI, MACD) for confluence-based trading decisions.
Trading Applications & Strategies
5. Trend Confirmation & Institutional VWAP Tracking
If price consistently holds above the primary AVWAP, it signals a bullish trend.
If price remains below AVWAP, it indicates selling pressure and a bearish trend.
Monitor retests of AVWAP levels for potential trend continuation or reversal.
6. Dynamic Support & Resistance Levels
AVWAP lines act as dynamic floating support and resistance zones.
Price bouncing off AVWAP suggests continuation, whereas breakdowns indicate a shift in momentum.
Look for confluence with high-volume zones for stronger trade signals.
7. Mean Reversion & Statistical Edge Trading
Prices that deviate beyond +2 or -2 standard deviations often revert toward AVWAP.
Mean reversion traders can fade extended moves and target AVWAP re-tests.
Helps in identifying exhaustion points in trending markets.
8. Institutional Liquidity & Volume Footprints
Institutions often execute large trades near VWAP zones, causing price reactions.
Tracking multi-timeframe AVWAP levels allows traders to anticipate key liquidity areas.
Use higher timeframe AVWAPs as macro support/resistance for swing trading setups.
9. Enhancing Momentum Trading with AVWAP Oscillator
The oscillator provides a momentum-based measure of AVWAP deviations.
Helps in confirming entry and exit timing for trend-following trades.
Useful for pairing with stochastic oscillators, MACD, or RSI to validate trade decisions.
Best Practices & Trading Tips
Use in Conjunction with Volume Analysis: Combine with volume profiles, OBV, or CVD for increased accuracy.
Adjust Timeframes Based on Trading Style: Scalpers can focus on short-term AVWAP, while swing traders benefit from weekly/daily AVWAP tracking.
Backtest Different AVWAP Configurations: Experiment with different anchoring methods and lookback periods to optimize trade performance.
Monitor Institutional Order Flow: Identify key VWAP zones where institutional traders may be active.
Use with Other Technical Indicators: Enhance trading confidence by integrating with moving averages, Bollinger Bands, or Fibonacci retracements.
Final Thoughts & Disclaimer
The Multiple AVWAP indicator provides a comprehensive approach to volume-weighted price tracking, making it ideal for professional traders. While this tool enhances market clarity and trade decision-making, it should be used as part of a well-rounded trading strategy with risk management principles in place.
This indicator is provided for informational and educational purposes only. Trading involves risk, and past performance is not indicative of future results. Always conduct your own analysis and due diligence before executing trades.
OmegaTools - Enhancing Market Clarity with Precision Indicators
Cari dalam skrip untuk "volume profile"
Delta Volume Channels [LucF]โโ OVERVIEW
This indicator displays on-chart visuals aimed at making the most of delta โvolume information. It can color bars and display two channels: one for delta โvolume, another calculated from the price levels of bars where delta โvolume divergences occur. Markers and alerts can also be configured using key conditions, and filtered in many different ways. The indicator caters to traders who prefer chart visuals over raw values. It will work on historical bars and in real time, using intrabar analysis to calculate delta โvolume in both conditions.
โโ CONCEPTS
Delta Volume
โThe โvolume delta concept divides a bar's โvolume in "up" and "down" โvolumes. The delta is calculated by subtracting down โvolume from up โvolume. Many calculation techniques exist to isolate up and down โvolume within a bar. The simplest techniques use the polarity of interbar price changes to assign their โvolume to up or down slots, e.g., On Balance Volume or the Klinger Oscillator . Others such as Chaikin Money Flow use assumptions based on a bar's OHLC values. The most precise calculation method uses tick data and assigns the โvolume of each tick to the up or down slot depending on whether the transaction occurs at the bid or ask price. While this technique is ideal, it requires huge amounts of data on historical bars, which usually limits the historical depth of charts and the number of symbols for which tick data is available.
This indicator uses intrabar analysis to achieve a compromise between the simplest and most precise methods of calculating โvolume delta. In the context where historical tick data is not yet available on TradingView, intrabar analysis is the most precise technique to calculate โvolume delta on historical bars on our charts. TradingView's Volume Profile built-in indicators use it, as do the CVD - Cumulative โVolume Delta Candles and CVD - Cumulative Volume Delta (Chart) indicators published from the TradingView account . My Volume Delta Columns Pro indicator also uses intrabar analysis. Other โvolume delta indicators such as my Realtime 5D Profile use realtime chart updates to achieve more precise โvolume delta calculations. Indicators of that type cannot be used on historical bars however; they only work in real time.
This is the logic I use to assign intrabar โvolume to up or down slots:
โโข If the intrabar's open and close values are different, their relative position is used.
โโข If the intrabar's open and close values are the same, the difference between the intrabar's close and the previous intrabar's close is used.
โโข As a last resort, when there is no movement during an intrabar and it closes at the same price as the previous intrabar, the last known polarity is used.
Once all intrabars making up a chart bar have been analyzed and the up or down property of each intrabar's โvolume determined, the up volumes are added and the down volumes subtracted. The resulting value is โvolume delta for that chart bar, which can be used as an estimate of the buying/selling pressure on an instrument.
Delta โVolume Percent (DV%)
This value is the proportion that delta โvolume represents of the total intrabar โvolume in the chart bar. Note that on some symbols/timeframes, the total intrabar โvolume may differ from the chart's โvolume for a bar, but that will not affect our calculations since we use the total intrabar โvolume.
Delta โVolume Channel
The โโDV channel is the space between two moving averages: the reference line and a DV%-weighted version of that reference. The reference line is a moving average of a type, source and length which you select. The DV%-weighted line uses the same settings, but it averages the DV%-weighted price source.
The weight applied to the source of the reference line is calculated from two values, which are multiplied: DV% and the relative size of the bar's โvolume in relation to previous bars. The effect of this is that DV% values on bars with higher total โvolume will carry greater weight than those with lesser โvolume.
The โDV channel can be in one of four states, each having its corresponding color:
โโข Bull (teal): The DV%-weighted line is above the reference line.
โโข Strong bull (lime): The bull condition is fulfilled and the bar's close is above the reference line and both the reference and the DV%-weighted lines are rising.
โโข Bear (maroon): The DV%-weighted line is below the reference line.
โโข Strong bear (pink): The bear condition is fulfilled and the bar's close is below the reference line and both the reference and the DV%-weighted lines are falling.
Divergences
In the context of this indicator, a divergence is any bar where the slope of the reference line does not match that of the DV%-weighted line. No directional bias is assigned to divergences when they occur.
Divergence Channel
The divergence channel is the space between two levels (by default, the bar's low and high ) saved when divergences occur. When price has breached a channel and a new divergence occurs, a new channel is created. Until that new channel is breached, bars where additional divergences occur will expand the channel's levels if the bar's price points are outside the channel.
Prices breaches of the divergence channel will change its state. Divergence channels can be in one of five different states:
โโข Bull (teal): Price has breached the channel to the upside.
โโข Strong bull (lime): The bull condition is fulfilled and the โDV channel is in the strong bull state.
โโข Bear (maroon): Price has breached the channel to the downside.
โโข Strong bear (pink): The bear condition is fulfilled and the โDV channel is in the strong bear state.
โโข Neutral (gray): The channel has not been breached.
โโ HOW TO USE THE INDICATOR
Load the indicator on an active chart (see here if you don't know how).
The default configuration displays:
โโข The โDV channel, without the reference or DV%-weighted lines.
โโข The Divergence channel, without its level lines.
โโข Bar colors using the state of the โDV channel.
The default settings use an Arnaud-Legoux moving average on the close and a length of 20 bars. The DV%-weighted version of it uses a combination of DV% and relative โvolume to calculate the ultimate weight applied to the reference. The DV%-weighted line is capped to 5 standard deviations of the reference. The lower timeframe used to access intrabars automatically adjusts to the chart's timeframe and achieves optimal balance between the number of intrabars inspected in each chart bar, and the number of chart bars covered by the script's calculations.
The Divergence channel's levels are determined using the high and low of the bars where divergences occur. Breaches of the channel require a bar's low to move above the top of the channel, and the bar's high to move below the channel's bottom.
No markers appear on the chart; if you want to create alerts from this script, you will need first to define the conditions that will trigger the markers, then create the alert, which will trigger on those same conditions.
To learn more about how to use this indicator, you must understand the concepts it uses and the information it displays, which requires reading this description. There are no videos to explain it.
โโ FEATURES
The script's inputs are divided in four sections: "DV channel", "Divergence channel", "Other Visuals" and "Marker/Alert Conditions". The first setting is the selection method used to determine the intrabar precision, i.e., how many lower timeframe bars (intrabars) are examined in each chart bar. The more intrabars you analyze, the more precise the calculation of DV% results will be, but the less chart coverage can be covered by the script's calculations.
DV Channel
Here, you control the visibility and colors of the reference line, its weighted version, and the DV channel between them.
You also specify what type of moving average you want to use as a reference line, its source and length. This acts as the โDV channel's baseline. The DV%-weighted line is also a moving average of the same type and length as the reference line, except that it will be calculated from the DV%-weighted source used in the reference line. By default, the DV%-weighted line is capped to five standard deviations of the reference line. You can change that value here. This section is also where you can disable the relative โvolume component of the weight.
Divergence Channel
This is where you control the appearance of the divergence channel and the key price values used in determining the channel's levels and breaching conditions. These choices have an impact on the behavior of the channel. More generous level prices like the default low and high selection will produce more conservative channels, as will the default choice for breach prices.
In this section, you can also enable a mode where an attempt is made to estimate the channel's bias before price breaches the channel. When it is enabled, successive increases/decreases of the channel's top and bottom levels are counted as new divergences occur. When one count is greater than the other, a bull/bear bias is inferred from it.
Other Visuals
You specify here:
โโข The method used to color chart bars, if you choose to do so.
โโข The display of a mark appearing above or below bars when a divergence occurs.
โโข If you want raw values to appear in tooltips when you hover above chart bars. The default setting does not display them, which makes the script faster.
โโข If you want to display an information box which by default appears in the lower left of the chart.
โโIt shows which lower timeframe is used for intrabars, and the average number of intrabars per chart bar.
Marker/Alert Conditions
Here, you specify the conditions that will trigger up or down markers. The trigger conditions can include a combination of state transitions of the โDV and the divergence channels. The triggering conditions can be filtered using a variety of conditions.
Configuring the marker conditions is necessary before creating an alert from this script, as the alert will use the marker conditions to trigger.
Markers only appear on bar closes, so they will not repaint. Keep in mind, when looking at markers on historical bars, that they are positioned on the bar when it closes โ NOT when it opens.
Raw values
The raw values calculated by this script can be inspected using a tooltip and the Data Window. The tooltip is visible when you hover over the top of chart bars. It will display on the last 500 bars of the chart, and shows the values of โDV, DV%, the combined weight, and the intermediary values used to calculate them.
โโ INTERPRETATION
The aim of the โDV channel is to provide a visual representation of the buying/selling pressure calculated using delta โvolume. The simplest characteristic of the channel is its bull/bear state. One can then distinguish between its bull and strong bull states, as transitions from strong bull to bull states will generally happen when buyers are losing steam. While one should not infer a reversal from such transitions, they can be a good place to tighten stops. Only time will tell if a reversal will occur. One or more divergences will often occur before reversals.
The nature of the divergence channel's design makes it particularly adept at identifying consolidation areas if its settings are kept on the conservative side. A gray divergence channel should usually be considered a no-trade zone. More adventurous traders can use the โDV channel to orient their trade entries if they accept the risk of trading in a neutral divergence channel, which by definition will not have been breached by price.
If your charts are already busy with other stuff you want to hold on to, you could consider using only the chart bar coloring component of this indicator:
At its simplest, one way to use this indicator would be to look for overlaps of the strong bull/bear colors in both the โDV channel and a divergence channel, as these identify points where price is breaching the divergence channel when buy/sell pressure is consistent with the direction of the breach. I have highlighted all those points in the chart below. Not all of them would have produced profitable trades, but nothing is perfect in the markets. Also, keep in mind that the circles identify the visual you would be looking for โ not the trade's entry level.
โโ LIMITATIONS
โโข The script will not work on symbols where no โvolume is available. An error will appear when that is the case.
โโข Because a maximum of 100K intrabars can be analyzed by a script, a compromise is necessary between the number of intrabars analyzed per chart bar
โโand chart coverage. The more intrabars you analyze per chart bar, the less coverage you will obtain.
โโThe setting of the "Intrabar precision" field in the "DV channel" section of the script's inputs
โโis where you control how the lower timeframe is calculated from the chart's timeframe.
โโ NOTES
Volume Quality
If you use โvolume, it's important to understand its nature and quality, as it varies with sectors and instruments. My Volume X-ray indicator is one way you can appraise the quality of an instrument's intraday โvolume.
For Pine Scriptโข Coders
โโข This script uses the new overload of the fill() function which now makes it possible to do vertical gradients in Pine. I use it for both channels displayed by this script.
โโข I use the new arguments for plot() 's `display` parameter to control where the script plots some of its values,
โโnamely those I only want to appear in the script's status line and in the Data Window.
โโข I wrote my script using the revised recommendations in the Style Guide from the Pine v5 User Manual.
โโ THANKS
To PineCoders . I have used their lower_tf library in this script, to manage the calculation of the LTF and intrabar stats, and their Time library to convert a timeframe in seconds to a printable form for its display in the Information box.
To TradingView's Pine Scriptโข team. Their innovations and improvements, big and small, constantly expand the boundaries of the language. What this script does would not have been possible just a few months back.
And finally, thanks to all the users of my scripts who take the time to comment on my publications and suggest improvements. I do not reply to all but I do read your comments and do my best to implement your suggestions with the limited time that I have.
CVD - Cumulative Volume Delta Candlesโ โ OVERVIEW
This indicator displays cumulative โvolume delta in candle form. It uses intrabar information to obtain more precise โvolume delta information than methods using only the chart's timeframe.
โ โ CONCEPTS
Bar polarity
By bar polarity , we mean the direction of a bar, which is determined by looking at the bar's close vs its open .
Intrabars
Intrabars are chart bars at a lower timeframe than the chart's. Each 1H chart bar of a 24x7 market will, for example, usually contain 60 bars at the lower timeframe of 1min, provided there was market activity during each minute of the hour. Mining information from intrabars can be useful in that it offers traders visibility on the activity inside a chart bar.
Lower timeframes (LTFs)
A lower timeframe is a timeframe that is smaller than the chart's timeframe. This script uses a โLTF to access intrabars. The lower the โLTF, the more intrabars are analyzed, but the less chart bars can display โCVD information because there is a limit to the total number of intrabars that can be analyzed.
Volume delta
The โvolume delta concept divides a bar's โvolume in "up" and "down" โvolumes. The delta is calculated by subtracting down โvolume from up โvolume. Many calculation techniques exist to isolate up and down โvolume within a bar. The simplest techniques use the polarity of interbar price changes to assign their โvolume to up or down slots, e.g., On Balance Volume or the Klinger Oscillator . Others such as Chaikin Money Flow use assumptions based on a bar's OHLC values. The most precise calculation method uses tick data and assigns the โvolume of each tick to the up or down slot depending on whether the transaction occurs at the bid or ask price. While this technique is ideal, it requires huge amounts of data on historical bars, which usually limits the historical depth of charts and the number of symbols for which tick data is available.
This indicator uses intrabar analysis to achieve a compromise between the simplest and most precise methods of calculating โvolume delta. In the context where historical tick data is not yet available on TradingView, intrabar analysis is the most precise technique to calculate โvolume delta on historical bars on our charts. Our Volume Profile indicators use it. Other โvolume delta indicators in our Community Scripts such as the Realtime 5D Profile use realtime chart updates to achieve more precise โvolume delta calculations, but that method cannot be used on historical bars, so those indicators only work in real time.
This is the logic we use to assign intrabar โvolume to up or down slots:
โโข If the intrabar's open and close values are different, their relative position is used.
โโข If the intrabar's open and close values are the same, the difference between the intrabar's close and the previous intrabar's close is used.
โโข As a last resort, when there is no movement during an intrabar and it closes at the same price as the previous intrabar, the last known polarity is used.
Once all intrabars making up a chart bar have been analyzed and the up or down property of each intrabar's โvolume determined, the up volumes are added and the down volumes subtracted. The resulting value is โvolume delta for that chart bar.
โ โ FEATURES
CVD Candles
Cumulative โVolume Delta Candles present โvolume delta information as it evolves during a period of time.
This is how each candle's levels are calculated:
โโข open : Each candle's' open level is the cumulative โvolume delta for the current period at the start of the bar.
โโThis value becomes zero on the first candle following a โCVD reset.
โโThe candles after the first one always open where the previous candle closed.
โโThe candle's high, low and close levels are then calculated by adding or subtracting a โvolume value to the open.
โโข high : The highest โโvolume delta value found in intrabars. If it is not higher than the โvolume delta for the bar, then that candle will have no upper wick.
โโข low : The lowest โโvolume delta value found in intrabars. If it is not lower than the โvolume delta for the bar, then that candle will have no lower wick.
โโข close : The aggregated โvolume delta for all intrabars. If โvolume delta is positive for the chart bar, then the candle's close will be higher than its open, and vice versa.
The candles are plotted in one of two configurable colors, depending on the polarity of โvolume delta for the bar.
CVD resets
The "cumulative" part of the indicator's name stems from the fact that calculations accumulate during a period of time. This allows you to analyze the progression of โvolume delta across manageable chunks, which is often more useful than looking at โvolume delta cumulated from the beginning of a chart's history.
You can configure the reset period using the "CVD Resets" input, which offers the following selections:
โโข None : Calculations do not reset.
โโข On a fixed higher timeframe : Calculations reset on the higher timeframe you select in the "Fixed higher timeframe" field.
โโข At a fixed time that you specify.
โโข At the beginning of the regular session .
โโข On a stepped higher timeframe : Calculations reset on a higher timeframe automatically stepped using the chart's timeframe and following these rules:
Chart TF โHTF
< 1min 1H
< 3H 1D
<= 12H 1W
< 1W 1M
>= 1W 1Y
The indicator's background shows where resets occur.
Intrabar precision
The precision of calculations increases with the number of intrabars analyzed for each chart bar. It is controlled through the script's "Intrabar precision" input, which offers the following selections:
โโข Least precise, covering many chart bars
โโข Less precise, covering some chart bars
โโข More precise, covering less chart bars
โโข Most precise, 1min intrabars
As there is a limit to the number of intrabars that can be analyzed by a script, a tradeoff occurs between the number of intrabars analyzed per chart bar and the chart bars for which calculations are possible.
Total โvolume candles
You can choose to display candles showing the total intrabar โvolume for the chart bar. This provides you with more context to evaluate a bar's โvolume delta by showing it relative to the sum of intrabar โvolume. Note that because of the reasons explained in the "NOTES" section further down, the total โvolume is the sum of all intrabar โโvolume rather than the โvolume of the bar at the chart's timeframe.
Total โvolume candles can be configured with their own up and down colors. You can also control the opacity of their bodies to make them more or less prominent. This publication's chart shows the indicator with total โvolume candles. They are turned off by default, so you will need to choose to display them in the script's inputs for them to plot.
Divergences
Divergences occur when the polarity of โvolume delta does not match that of the chart bar. You can identify divergences by coloring the โCVD candles differently for them, or by coloring the indicator's background.
Information box
An information box in the lower-left corner of the indicator displays the HTF used for resets, the โLTF used for intrabars, and the average quantity of intrabars per chart bar. You can hide the box using the script's inputs.
โ โ INTERPRETATION
The first thing to look at when analyzing โCVD candles is the side of the zero line they are on, as this tells you if โCVD is generally โbullish or โbearish. Next, one should consider the relative position of successive candles, just as you would with a price chart. Are successive candles trending up, down, or stagnating? Keep in mind that whatever trend you identify must be considered in the context of where it appears with regards to the zero line; an uptrend in a negative โCVD (below the zero line) may not be as powerful as one taking place in positive โCVD values, but it may also predate a movement into positive โCVD territory. The same goes with stagnation; a trader in a long position will find stagnation in positive โCVD territory less worrisome than stagnation under the zero line.
After consideration of the bigger picture, one can drill down into the details. Exactly what you are looking for in markets will, of course, depend on your trading methodology, but you may find it useful to:
โ โข Evaluate โvolume delta for the bar in relation to price movement for that bar.
โ โข Evaluate the proportion that โโvolume delta represents of total โvolume.
โ โข Notice divergences and if the chart's candle shape confirms a hesitation point, as a Doji would.
โ โข Evaluate if the progress of โCVD candles correlates with that of chart bars.
โ โข Analyze the wicks. As with price candles, long wicks tend to indicate weakness.
Always keep in mind that unless you have chosen not to reset it, your โCVD resets for each period, whether it is fixed or automatically stepped. Consequently, any trend from the preceding period must re-establish itself in the next.
โ โ NOTES
Know your volume
Traders using โvolume information should understand the โvolume data they are using: where it originates and what transactions it includes, as this can vary with instruments, sectors, exchanges, timeframes, and between historical and realtime bars. The information used to build a chart's bars and display โvolume comes from data providers (exchanges, brokers, etc.) who often maintain distinct feeds for intraday and โend-of-day (โEOD) timeframes. How โvolume data is assembled for the two feeds depends on how instruments are traded in that sector and/or the โvolume reporting policy for each feed. Instruments from crypto and forex markets, for example, will often display similar โvolume on both feeds. Stocks will often display variations because block trades or other types of trades may not be included in their intraday โvolume data. โFutures will also typically display variations.
Note that as intraday vs โEOD variations exist for historical bars on some instruments, differences may also exist between the realtime feeds used on intraday vs 1D or greater timeframes for those same assets. Realtime reporting rules will often be different from historical feed reporting rules, so variations between realtime feeds will often be different from the variations between historical feeds for the same instrument. The Volume X-ray indicator can help you analyze differences between intraday and โEOD โvolumes for the instruments you trade.
If every unit of โvolume is both bought by a buyer and sold by a seller, how can โvolume delta make sense?
Traders who do not understand the mechanics of matching engines (the exchange software that matches orders from buyers and sellers) sometimes argue that the concept of โvolume delta is flawed, as every unit of โvolume is both bought and sold. While they are rigorously correct in stating that every unit of โvolume is both bought and sold, they overlook the fact that information can be mined by analyzing variations in the price of successive ticks, or in our case, intrabars.
Our calculations model the situation where, in fully automated order handling, market orders are generally matched to limit orders sitting in the order book. Buy market orders are matched to quotes at the ask level and sell market orders are matched to quotes at the bid level. As explained earlier, we use the same logic when comparing intrabar prices. While using intrabar analysis does not produce results as precise as when individual transactions โ or ticks โ are analyzed, results are much more precise than those of methods using only chart prices.
Not only does the concept underlying โvolume delta make sense, it provides a window on an oft-overlooked variable which, with price and time, is the only basic information representing market activity. Furthermore, because the calculation of โvolume delta also uses price and time variations, one could conceivably surmise that it can provide a more complete model than ones using price and time only. Whether or not โvolume delta can be useful in your trading practice, as usual, is for you to decide, as each trader's methodology is different.
For Pine Scriptโข coders
As our latest Polarity Divergences publication, this script uses the recently released request.security_lower_tf() Pine Scriptโข function discussed in this blog post . It works differently from the usual request.security() in that it can only be used at LTFs, and it returns an array containing one value per intrabar. This makes it much easier for programmers to access intrabar information.
Look first. Then leap.
Delta Volume Columns Pro [LucF]โโ OVERVIEW
This indicator displays volumeโโ delta information calculated with intrabar inspection on historical bars, and feed updates when running in realtime. It is designed to run in a pane and can display either stacked buy/sell volumeโ columns or a signal line which can be calculated and displayed in many different ways.
Five different models are offered to reveal different characteristics of the calculated volumeโ delta information. Many options are offered to visualize the calculations, giving you much leeway in morphing the indicator's visuals to suit your needs. If you value delta volumeโ information, I hope you will find the time required to master Delta Volumeโ Columns Pro well worth the investment. I am confident that if you combine a proper understanding of the indicator's information with an intimate knowledge of the volumeโ idiosyncrasies on the markets you trade, you can extract useful market intelligence using this tool.
โโ WARNINGS
1. The indicator only works on markets where volumeโ information is available,
โโPlease validate that your symbol's feed carries volumeโ information before asking me why the indicator doesn't plot values.
2. When you refresh your chart or re-execute the script on the chart, the indicator will repaint because elapsed realtime bars will then recalculate as historical bars.
3. Because the indicator uses different modes of calculation on historical and realtime bars, it's critical that you understand the differences between them. Details are provided further down.
4. Calculations using intrabar inspection on historical bars can only be done from some chart timeframes. See further down for a list of supported timeframes.
โโIf the chart's timeframe is not supported, no historical volumeโ delta will display.
โโ CONCEPTS
Chart bars
Three different types of bars are used in charts:
โ1. Historical bars are bars that have already closed when the script executes on them.
โ2. The realtime bar is the current, incomplete bar where a script is running on an open market. There is only one active realtime bar on your chart at any given time.
โโโThe realtime bar is where alerts trigger.
โ3. Elapsed realtime bars are bars that were calculated when they were realtime bars but have since closed.
โโโWhen a script re-executes on a chart because the browser tab is refreshed or some of its inputs are changed, elapsed realtime bars are recalculated as historical bars.
Why does this indicator use two modes of calculation?
Historical bars on TradingView charts contain OHLCV data only, which is insufficient to calculate volumeโ delta on them with any level of precision. To mine more detailed information from those bars we look at intrabars , i.e., bars from a smaller timeframe (we call it the intrabar timeframe ) that are contained in one chart bar. If your chart Is running at 1D on a 24x7 market for example, most 1D chart bars will contain 24 underlying 1H bars in their dilation. On historical bars, this indicator looks at those intrabars to amass volumeโ delta information. If the intrabar is up, its volumeโ goes in the Buy bin, and inversely for the Sell bin. When price does not move on an intrabar, the polarity of the last known movement is used to determine in which bin its volumeโ goes.
In realtime, we have access to price and volumeโ change for each update of the chart. Because a 1D chart bar can be updated tens of thousands of times during the day, volumeโ delta calculations on those updates is much more precise. This precision, however, comes at a price:
โโ The script must be running on the chart for it to keep calculating in realtime.
โโ If you refresh your chart you will lose all accumulated realtime calculations on elapsed realtime bars, and the realtime bar.
โโElapsed realtime bars will recalculate as historical bars, i.e., using intrabar inspection, and the realtime bar's calculations will reset.
โโWhen the script recalculates elapsed realtime bars as historical bars, the values on those bars will change, which means the script repaints in those conditions.
โโ When the indicator first calculates on a chart containing an incomplete realtime bar, it will count ALL the existing volumeโ on the bar as Buy or Sell volumeโ,
โโdepending on the polarity of the bar at that point. This will skew calculations for that first bar. Scripts have no access to the history of a realtime bar's previous updates,
โโand intrabar inspection cannot be used on realtime bars, so this is the only to go about this.
โโ Even if alerts only trigger upon confirmation of their conditions after the realtime bar closes, they are repainting alerts
โโbecause they would perhaps not have calculated the same way using intrabar inspection.
โโ On markets like stocks that often have different EODโ and intraday feeds and volumeโ information,
โโthe volume's scale may not be the same for the realtime bar if your chart is at 1D, for example,
โโand the indicator is using an intraday timeframe to calculate on historical bars.
โโ Any chart timeframe can be used in realtime mode, but plots that include moving averages in their calculations may require many elapsed realtime bars before they can calculate.
โโYou might prefer drastically reducing the periods of the moving averages, or using the volumeโ columns mode, which displays instant values, instead of the line.
Volume Delta Balances
This indicator uses a variety of methods to evaluate five volumeโ delta balances and derive other values from those balances. The five balances are:
1 โ On Bar Balance : This is the only balance using instant values; it is simply the subtraction of the Sell volumeโ from the Buy volumeโ on the bar.
2 โ Average Balance : Calculates a distinct EMA for both the Buy and Sell volumes, and subtracts the Sell EMA from the Buy EMA.
3 โ Momentum Balance : Starts by calculating, separately for both Buy and Sell volumes, the difference between the same EMAs used in "Average Balance" and
โโan SMA of double the period used for the "Average Balance" EMAs. The difference for the Sell side is subtracted from the difference for the Buy side,
โโand an RSI of that value is calculated and brought over the โ50/+50 scale.
4 โ Relative Balance : The reference values used in the calculation are the Buy and Sell EMAs used in the "Average Balance".
โโFrom those, we calculate two intermediate values using how much the instant Buy and Sell volumes on the bar exceed their respective EMAโโโbut with a twist.
โโIf the bar's Buy volumeโ does not exceed the EMA of Buy volumeโ, a zero value is used. The same goes for the Sell volumeโ with the EMA of Sell volumeโ.
โโOnce we have our two intermediate values for the Buy and Sell volumes exceeding their respective MA, we subtract them. The final "Relative Balance" value is an ALMA of that subtraction.
โโThe rationale behind using zero values when the bar's Buy/Sell volumeโ does not exceed its EMA is to only take into account the more significant volumeโ.
โโIf both instant volumeโ values exceed their MA, then the difference between the two is the signal's value.
โโThe signal is called "relative" because the intermediate values are the difference between the instant Buy/Sell volumes and their respective MA.
โโThis balance flatlines when the bar's Buy/Sell volumes do not exceed their EMAs, which makes it useful to spot areas where trader interest dwindles, such as consolidations.
โโThe smaller the period of the final value's ALMA, the more easily you will see the balance flatline. These flat zones should be considered no-trade zones.
5 โ Percent Balance : This balance is the ALMA of the ratio of the "On Bar Balance" value, i.e., the volumeโ delta balance on the bar (which can be positive or negative),
โโover the total volume for that bar.
From the balances and marker conditions, two more values are calculated:
1 โ Marker Bias : It sums the up/down (+1/โ1) occurrences of the markers 1 to 4 over a period you define, so it ranges from โ4 to +4, times the period.
โโIts calculation will depend on the modes used to calculate markers 3 and 4.
2 โ Combined Balances : This is the sum of the bull/bear (+1/โ1) states of each of the five balances, so it ranges from โ5 to +5.
โโ FEATURES
The indicator has two main modes of operation: Columns and Line .
Columns
โข In Columns mode you can display stacked Buy/Sell volumeโ columns.
โข The buy section always appears above the centerline, the sell section below.
โข The top and bottom sections can be colored independently using eight different methods.
โข The EMAs of the Buy/Sell values can be displayed (these are the same EMAs used to calculate the "Average Balance").
Line
โข Displays one of seven signals: the five balances or one of two complementary values, i.e., the "Marker Bias" or the "Combined Balances".
โข You can color the line and its fill using independent calculation modes to pack more information in the display.
โYou can thus appraise the state of 3 different values using the line itself, its color and the color of its fill.
โข A "Divergence Levels" feature will use the line to automatically draw expanding levels on divergence events.
Default settings
Using the indicator's default settings, this is the information displayed:
โข The line is calculated on the "Average Balance".
โข The line's color is determined by the bull/bear state of the "Percent Balance".
โข The line's fill gradient is determined by the advances/declines of the "Momentum Balance".
โข The orange divergence dots are calculated using discrepancies between the polarity of the "On Bar Balance" and the chart's bar.
โข The divergence levels are determined using the line's level when a divergence occurs.
โข The background's fill gradient is calculated on advances/declines of the "Marker Bias".
โข The chart bars are colored using advances/declines of the "Relative Balance". Divergences are shown in orange.
โข The intrabar timeframe is automatically determined from the chart's timeframe so that a minimum of 50 intrabars are used to calculate volumeโ delta on historical bars.
Alerts
The configuration of the marker conditions explained further is what determines the conditions that will trigger alerts created from this script. Note that simply selecting the display of markers does not create alerts. To create an alert on this script, you must use ALT-A from the chart. You can create multiple alerts triggering on different conditions from this same script; simply configure the markers so they define the trigger conditions for each alert before creating the alert. The configuration of the script's inputs is saved with the alert, so from then on you can change them without affecting the alert. Alert messages will mention the marker(s) that triggered the specific alert event. Keep in mind, when creating alerts on small chart timeframes, that discrepancies between alert triggers and markers displayed on your chart are to be expected. This is because the alert and your chart are running two distinct instances of the indicator on different servers and different feeds. Also keep in mind that while alerts only trigger on confirmed conditions, they are calculated using realtime calculation mode, which entails that if you refresh your chart and elapsed realtime bars recalculate as historical bars using intrabar inspection, markers will not appear in the same places they appeared in realtime. So it's important to understand that even though the alert conditions are confirmed when they trigger, these alerts will repaint.
Let's go through the sections of the script's inputs.
Columns
The size of the Buy/Sell columns always represents their respective importance on the bar, but the coloring mode for tops and bottoms is independent. The default setup uses a standard coloring mode where the Buy/Sell columns are always in the bull/bear color with a higher intensity for the winning side. Seven other coloring modes allow you to pack more information in the columns. When choosing to color the top columns using a bull/bear gradient on "Average Balance", for example, you will have bull/bear colored tops. In order for the color of the bottom columns to continue to show the instant bar balance, you can then choose the "On Bar Balance โ Dual Solid Colors" coloring mode to make those bars the color of the winning side for that bar. You can display the averages of the Buy and Sell columns. If you do, its coloring is controlled through the "Line" and "Line fill" sections below.
Line and Line fill
You can select the calculation mode and the thickness of the line, and independent calculations to determine the line's color and fill.
Zero Line
The zero line can display dots when all five balances are bull/bear.
Divergences
You first select the detection mode. Divergences occur whenever the up/down direction of the signal does not match the up/down polarity of the bar. Divergences are used in three components of the indicator's visuals: the orange dot, colored chart bars, and to calculate the divergence levels on the line. The divergence levels are dynamic levels that automatically build from the line's values on divergence events. On consecutive divergences, the levels will expand, creating a channel. This implementation of the divergence levels corresponds to my view that divergences indicate anomalies, hesitations, points of uncertainty if you will. It precludes any attempt to identify a directional bias to divergences. Accordingly, the levels merely take note of divergence events and mark those points in time with levels. Traders then have a reference point from which they can evaluate further movement. The bull/bear/neutral colors used to plot the levels are also congruent with this view in that they are determined by the line's position relative to the levels, which is how I think divergences can be put to the most effective use. One of the coloring modes for the line's fill uses advances/declines in the line after divergence events.
Background
The background can show a bull/bear gradient on six different calculations. As with other gradients, you can adjust its brightness to make its importance proportional to how you use it in your analysis.
Chart bars
Chart bars can be colored using seven different methods. You have the option of emptying the body of bars where volumeโ does not increase, as does my TLD indicator, and you can choose whether you want to show divergences.
Intrabar Timeframe
This is the intrabar timeframe that will be used to calculate volumeโ delta using intrabar inspection on historical bars. You can choose between four modes. The three "Auto-steps" modes calculate, from the chart's timeframe, the intrabar timeframe where the said number of intrabars will make up the dilation of chart bars. Adjustments are made for non-24x7 markets. "Fixed" mode allows you to select the intrabar timeframe you want. Checking the "Show TF" box will display in the lower-right corner the intrabar timeframe used at any given moment. The proper selection of the intrabar timeframe is important. It must achieve maximal granularity to produce precise results while not unduly slowing down calculations, or worse, causing runtime errors. Note that historical depth will vary with the intrabar timeframe. The smaller the timeframe, the shallower historical plots you will be.
Markers
Markers appear when the required condition has been confirmed on a closed bar. The configuration of the markers when you create an alert is what determines when the alert will trigger. Five markers are available:
โข Balances Agreement : All five balances are either bullishโ or bearishโ.
โข Double Bumps : A double bump is two consecutive up/down bars with +/โ volumeโโ delta, and rising Buy/Sell volumeโ above its average.
โข Divergence confirmations : A divergence is confirmed up/down when the chosen balance is up/down on the previous bar when that bar was down/up, and this bar is up/down.
โข Balance Shifts : These are bull/bear transitions of the selected signal.
โข Marker Bias Shifts : Marker bias shifts occur when it crosses into bull/bear territory.
Periods
Allows control over the periods of the different moving averages used to calculate the balances.
Volumeโ Discrepancies
Stock exchanges do not report the same volumeโ for intraday and daily (or higher) resolutions. Other variations in how volumeโ information is reported can also occur in other markets, namely Forex, where volumeโ irregularities can even occur between different intraday timeframes. This will cause discrepancies between the total volumeโ on the bar at the chart's timeframe, and the total volumeโโ calculated by adding the volumeโโ of the intrabars in that bar's dilation. This does not necessarily invalidate the volumeโโ delta information calculated from intrabars, but it tells us that we are using partial volumeโ data. A mechanism to detect chart vs intrabar timeframe volumeโโ discrepancies is provided. It allows you to define a threshold percentage above which the background will indicate a difference has been detected.
Other Settings
You can control here the display of the gray dot reminder on realtime bars, and the display of error messages if you are using a chart timeframe that is not greater than the fixed intrabar timeframe, when you use that mode. Disabling the message can be useful if you only use realtime mode at chart timeframes that do not support intrabar inspection.
โโ RAMBLINGS
On Volumeโ Delta
Volumeโ is arguably the best complement to interpret price action, and I consider volumeโ delta to be the most effective way of processing volumeโ information. In periods of low-volatility price consolidations, volumeโ will typically also be lower than normal, but slight imbalances in the trend of the buy/sell volumeโ balance can sometimes help put early odds on the direction of the break from consolidation. Additionally, the progression of the volumeโ imbalance can help determine the proximity of the breakout. I also find volumeโ delta and the number of divergences very useful to evaluate the strength of trends. In trends, I am looking for "slow and steady", i.e., relatively low volatilityโ and pauses where price action doesn't look like world affairs are being reassessed. In my personal mythology, this type of trend is often more resilient than high-volatility breakouts, especially when volumeโ balance confirms the general agreement of traders signaled by the low-volatility usually accompanying this type of trend. The volumeโ action on pauses will often help me decide between aggressively taking profits, tightening a stop or going for a longer-term movement. As for reversals, they generally occur in high-volatility areas where entering trades is more expensive and riskier. While the identification of counter-trend reversals fascinates many traders to no end, they represent poor opportunities in my view. Volumeโ imbalances often precede reversals, but I prefer to use volumeโ delta information to identify the areas following reversals where I can confirm them and make relatively low-cost entries with better odds.
On "Buy/Sell" Volume
Buying or selling volumeโ are misnomers, as every unit of volumeโ transacted is both bought and sold by two different traders. While this does not keep me from using the terms, there is no such thing as โbuy onlyโ or โsell onlyโ volumeโ. Trader lingo is riddled with peculiarities.
Divergences
The divergence detection method used here relies on a difference between the direction of a signal and the polarity (up/down) of a chart bar. When using the default "On Bar Balance" to detect divergences, however, only the bar's volumeโ delta is used. You may wonder how there can be divergences between buying/selling volumeโ information and price movement on one bar. This will sometimes be due to the calculation's shortcomings, but divergences may also occur in instances where because of order book structure, it takes less volumeโ to increase the price of an asset than it takes to decrease it. As usual, divergences are points of interest because they reveal imbalances, which may or may not become turning points. To your pattern-hungry brain, the divergences displayed by this indicator willโโโas they do on other indicatorsโโโappear to often indicate turnarounds. My opinion is that reality is generally quite sobering and I have no reliable information that would tend to prove otherwise. Exercise caution when using them. Consequently, I do not share the overwhelming enthusiasm of traders in identifying bullishโ/bearishโ divergences. For me, the best course of action when a divergence occurs is to wait and see what happens from there. That is the rationale underlying how my divergence levels work; they take note of a signal's level when a divergence occurs, and it's the signal's behavior from that point on that determines if the post-divergence action is bullishโ/bearishโ.
Superfluity
In "The Bed of Procrustes", Nassim Nicholas Taleb writes: To bankrupt a fool, give him information . This indicator can display lots of information. While learning to use a new indicator inevitably requires an adaptation period where we put it through its paces and try out all its options, once you have become used to it and decide to adopt it, rigorously eliminate the components you don't use and configure the remaining ones so their visual prominence reflects their relative importance in your analysis. I tried to provide flexible options for traders to control this indicator's visuals for that exact reasonโโโnot for window dressing.
โโ LIMITATIONS
โข This script uses a special characteristic of the `security()` function allowing the inspection of intrabarsโโโwhich is not officially supported by TradingView.
โIt has the advantage of permitting a more robust calculation of volumeโ delta than other methods on historical bars, but also has its limits.
โข Intrabar inspection only works on some chart timeframes: 3, 5, 10, 15 and 30 minutes, 1, 2, 3, 4, 6, and 12 hours, 1 day, 1 week and 1 month.
โThe scriptโs code can be modified to run on other resolutions.
โข When the difference between the chartโs timeframe and the intrabar timeframe is too great, runtime errors will occur. The Auto-Steps selection mechanisms should avoid this.
โข All volumeโ is not created equally. Its source, components, quality and reliability will vary considerably with sectors and instruments.
โThe higher the quality, the more reliably volumeโ delta information can be used to guide your decisions.
โYou should make it your responsibility to understand the volumeโ information provided in the data feeds you use. It will help you make the most of volumeโ delta.
โโ NOTES
For traders
โข The Data Window shows key values for the indicator.
โข While this indicator displays some of the same information calculated in my DeltaโVolumeโColumns ,
โI have elected to make it a separate publication so that traders continue to have a simpler alternative available to them. Both code bases will continue to evolve separately.
โข All gradients used in this indicator determine their brightness intensities using advances/declines in the signalโnot their relative position in a pre-determined scale.
โข Volumeโ delta being relative, by nature, it is particularly well-suited to Forex markets, as it filters out quite elegantly the cyclical volumeโ data characterizing the sector.
If you are interested in volumeโ delta, consider having a look at my other "Delta Volume" indicators:
โข DeltaโVolumeโRealtimeโAction displays realtime volumeโ delta and tick information on the chart.
โข DeltaโVolumeโCandles builds volumeโโ delta candles on the chart.
โข DeltaโVolumeโColumns is a simpler version of this indicator.
For coders
โข I use the `f_c_gradientRelativePro()` from the PineCoders Color Gradient Framework to build my gradients.
โThis function has the advantage of allowing begin/end colors for both the bull and bear colors. It also allows us to define the number of steps allowed for each gradient.
โI use this to modulate the gradients so they perform optimally on the combination of the signal used to calculate advances/declines,
โbut also the nature of the visual component the gradient applies to. I use fewer steps for choppy signals and when the gradient is used on discrete visual components
โsuch as volumeโ columns or chart bars.
โข I use the PineCoders Coding Conventions for Pine to write my scripts.
โข I used functions modified from the PineCoders MTF Selection Framework for the selection of timeframes.
โโ THANKS TO:
โ The devs from TradingView's Pine and other teams, and the PineCoders who collaborate with them. They are doing amazing work,
โand much of what this indicator does could not be done without their recent improvements to Pine.
โ A guy called Kuan who commented on a Backtest Rookies presentation of their Volume Profile indicator using a `for` loop.
โThis indicator started from the intrabar inspection technique illustrated in Kuan's snippet.
โ theheirophant , my partner in the exploration of the sometimes weird abysses of `security()`โs behavior at intrabar timeframes.
โ midtownsk8rguy , my brilliant companion in mining the depths of Pine graphics.
Advanced Range Analyzer ProAdvanced Range Analyzer Pro โ Adaptive Range Detection & Breakout Forecasting
Overview
Advanced Range Analyzer Pro is a comprehensive trading tool designed to help traders identify consolidations, evaluate their strength, and forecast potential breakout direction. By combining volatility-adjusted thresholds, volume distribution analysis, and historical breakout behavior, the indicator builds an adaptive framework for navigating sideways price action. Instead of treating ranges as noise, this system transforms them into opportunities for mean reversion or breakout trading.
How It Works
The indicator continuously scans price action to identify active range environments. Ranges are defined by volatility compression, repeated boundary interactions, and clustering of volume near equilibrium. Once detected, the indicator assigns a strength score (0โ100), which quantifies how well-defined and compressed the consolidation is.
Breakout probabilities are then calculated by factoring in:
Relative time spent near the upper vs. lower range boundaries
Historical breakout tendencies for similar structures
Volume distribution inside the range
Momentum alignment using auxiliary filters (RSI/MACD)
This creates a live probability forecast that updates as price evolves. The tool also supports range memory, allowing traders to analyze the last completed range after a breakout has occurred. A dynamic strength meter is displayed directly above each consolidation range, providing real-time insight into range compression and breakout potential.
Signals and Breakouts
Advanced Range Analyzer Pro includes a structured set of visual tools to highlight actionable conditions:
Range Zones โ Gradient-filled boxes highlight active consolidations.
Strength Meter โ A live score displayed in the dashboard quantifies compression.
Breakout Labels โ Probability percentages show bias toward bullish or bearish continuation.
Breakout Highlights โ When a breakout occurs, the range is marked with directional confirmation.
Dashboard Table โ Displays current status, strength, live/last range mode, and probabilities.
These elements update in real time, ensuring that traders always see the current state of consolidation and breakout risk.
Interpretation
Range Strength : High scores (70โ100) indicate strong consolidations likely to resolve explosively, while low scores suggest weak or choppy ranges prone to false signals.
Breakout Probability : Directional bias greater than 60% suggests meaningful breakout pressure. Equal probabilities indicate balanced compression, favoring mean-reversion strategies.
Market Context : Ranges aligned with higher timeframe trends often resolve in the dominant direction, while counter-trend ranges may lead to reversals or liquidity sweeps.
Volatility Insight : Tight ranges with low ATR imply imminent expansion; wide ranges signal extended consolidation or distribution phases.
Strategy Integration
Advanced Range Analyzer Pro can be applied across multiple trading styles:
Breakout Trading : Enter on probability shifts above 60% with confirmation of volume or momentum.
Mean Reversion : Trade inside ranges with high strength scores by fading boundaries and targeting equilibrium.
Trend Continuation : Focus on ranges that form mid-trend, anticipating continuation after consolidation.
Liquidity Sweeps : Use failed breakouts at boundaries to capture reversals.
Multi-Timeframe : Apply on higher timeframes to frame market context, then execute on lower timeframes.
Advanced Techniques
Combine with volume profiles to identify areas of institutional positioning within ranges.
Track sequences of strong consolidations for trend development or exhaustion signals.
Use breakout probability shifts in conjunction with order flow or momentum indicators to refine entries.
Monitor expanding/contracting range widths to anticipate volatility cycles.
Custom parameters allow fine-tuning sensitivity for different assets (crypto, forex, equities) and trading styles (scalping, intraday, swing).
Inputs and Customization
Range Detection Sensitivity : Controls how strictly ranges are defined.
Strength Score Settings : Adjust weighting of compression, volume, and breakout memory.
Probability Forecasting : Enable/disable directional bias and thresholds.
Gradient & Fill Options : Customize range visualization colors and opacity.
Dashboard Display : Toggle live vs last range, info table size, and position.
Breakout Highlighting : Choose border/zone emphasis on breakout events.
Why Use Advanced Range Analyzer Pro
This indicator provides a data-driven approach to trading consolidation phases, one of the most common yet underutilized market states. By quantifying range strength, mapping probability forecasts, and visually presenting risk zones, it transforms uncertainty into clarity.
Whether youโre trading breakouts, fading ranges, or mapping higher timeframe context, Advanced Range Analyzer Pro delivers a structured, adaptive framework that integrates seamlessly into multiple strategies.
Dynamic VWAP: Fair Value & Divergence SuiteDynamic VWAP: Fair Value & Divergence Suite
Dynamic VWAP: Fair Value & Divergence Suite is a comprehensive tool for tracking contextual valuation, overextension, and potential reversal signals in trending markets. Unlike traditional VWAP that anchors to the start of a session or a fixed period, this indicator dynamically resets the VWAP anchor to the most recent swing low. This design allows you to monitor how far price has extended from the most recent significant low, helping identify zones of potential profit-taking or reversion.
Deviation bands (standard deviations above the anchored VWAP) provide a clear visual framework to assess whether price is in a fair value zone (ยฑ1ฯ), moderately extended (+2ฯ), or in zones of extreme extension (+3ฯ to +5ฯ). The indicator also highlights contextual divergence signals, including slope deceleration, weak-volume retests, and deviation failuresโgiving you actionable confluence around potential reversal points.
Because the anchor updates dynamically, this tool is particularly well suited for trend-following assets like BTC or stocks in sustained moves, where price rarely returns to deep negative deviation zones. For this reason, the indicator focuses on upside extension rather than symmetrical reversion to a long-term mean.
๐ฏ Key Features
โ
Dynamic Swing Low Anchoring
Continuously re-anchors VWAP to the most recent swing low based on your chosen lookback period.
Provides context for trend progression and overextension relative to structural lows.
โ
Standard Deviation Bands
Plots up to +5ฯ deviation bands to visualize levels of overextension.
Extended bands (+3ฯ to +5ฯ) can be toggled for simplicity.
โ
Conditional Zone Fills
Colored background fills show when price is inside each valuation zone.
Helps you immediately see if price is in fair value, moderately extended, or highly stretched territory.
โ
Divergence Detection
VWAP Slope Divergence: Flags when price makes a higher high but VWAP slope decelerates.
Low Volume Retest: Highlights weak re-tests of VWAP on low volume.
Deviation Failure: Identifies when price reverts back inside +1ฯ after closing beyond +3ฯ.
โ
Volume Fallback
If volume is unavailable, uses high-low range as a proxy.
โ
Highly Customizable
Adjust lookbacks, show/hide extended bands, toggle fills, and enable or disable divergences.
๐ ๏ธ How to Use
Identify Buy and Sell Zones
Price in the fair value band (ยฑ1ฯ) suggests equilibrium.
Reaching +2ฯ to +3ฯ signals increasing overextension and potential areas to take profits.
+4ฯ to +5ฯ zones can be used to watch for exhaustion or mean-reversion setups.
Monitor Divergence Signals
Use slope divergence and deviation failures to look for confluence with overextension.
Low volume retests can flag rallies lacking conviction.
Adapt Swing Lookback
30โ50 bars: Faster re-anchoring for swing trading.
75โ100 bars: More stable anchors for longer-term trends.
๐งญ Best Practices
Combine the anchored VWAP with higher timeframe structure.
Confirm signals with other tools (momentum, volume profiles, or trend filters).
Use extended deviation zones as context, not as standalone signals.
โ ๏ธ Disclaimer
This script is for educational and informational purposes only. It does not constitute financial advice or a recommendation to buy or sell any security or asset. Always do your own research and consult a qualified financial professional before making any trading decisions. Past performance does not guarantee future results.
Exponential Action Map (EAM)### **Exponential Action Map (EAM) โ Description and Differences from VPVR**
The Exponential Action Map (EAM) indicator is a Pine Script-based volume profile indicator that offers **a weighted representation of buying and selling activity**. Unlike the standard **Volume Profile Visible Range (VPVR)**, which simply shows traded volume at various price levels, the EAM provides the following additional features:
1. **Exponential Weighting**:
- Instead of treating the volume of all considered bars equally, the EAM uses a **decay factor** to gradually diminish the significance of older data. This allows **more recent price movements to have greater influence**, making it particularly useful for short-term analysis.
2. **Exponential Stealth Move (ESM)**:
- In addition to buy and sell volume, the EAM calculates and displays the **Exponential Stealth Move (ESM)**.
- This measures the relative price movement compared to volume and highlights areas where **significant price changes occur with low volume**, which may indicate institutional activity or strong momentum.
- The ESM visualization is not present in VPVR, making it a distinct and valuable feature.
3. **Visualization Methodology**:
- Instead of simple histograms like in VPVR, volume is represented by **dynamic boxes** that encompass Buy (EBA), Sell (ESA), and Stealth Move (ESM) activities.
- The size and color of these boxes are **customizable**, allowing for clear differentiation between various volume types.
4. **Flexibility & Configuration**:
- Users can adjust parameters such as **Number of Bars, Decay Factor, Bar Width, and Maximum History Data**.
- The ability to **toggle historical data visibility** offers a **tailored view** that VPVR does not provide.
**Conclusion:** The EAM extends the classic volume profile (VPVR) by introducing **time-weighted volume analysis and detection of Stealth Moves (ESM)**. This not only highlights price levels with high trading volume but also reveals **price movements with low liquidity**, which can potentially indicate institutional interest.
Simplified Market ProfileVolume Bins: This script divides the price range into num_bins equal price levels. Each bin holds the cumulative volume for that price range.
Profile Length: The number of past bars that the profile considers for building the volume histogram.
Bin Size: The price range between bins is determined by dividing the difference between the highest and lowest prices over the specified range.
Volume Calculation: The script iterates over each bar within the specified range, determining which price bin the barโs volume should be added to.
Plotting: The script visualizes the volume profile as lines plotted horizontally at different price levels, with thickness proportional to the volume traded at that level.
CVD - Cumulative Volume Delta (Chart)โ โ OVERVIEW
This indicator displays cumulative โvolume delta (โCVD) as an on-chart oscillator. It uses intrabar analysis to obtain more precise โvolume delta information compared to methods that only use the chart's timeframe.
The core concepts in this script come from our first โ CVD indicator , which displays CVDโ values as plot candles in a separate indicator pane. In this script, CVโD values are scaled according to price ranges and represented on the main chart pane.
โ โ CONCEPTS
Bar polarity
Bar polarity refers to the position of the close price relative to the open price. In other words, bar polarity is the direction of price change.
Intrabars
Intrabars are chart bars at a lower timeframe than the chart's. Each 1H chart bar of a 24x7 market will, for example, usually contain 60 bars at the lower timeframe of 1min, provided there was market activity during each minute of the hour. Mining information from intrabars can be useful in that it offers traders visibility on the activity inside a chart bar.
Lower timeframes (LTFs)
A lower timeframe is a timeframe that is smaller than the chart's timeframe. This script utilizes a LTF to analyze intrabars, or price changes within a chart bar. The lower the โLTF, the more intrabars are analyzed, but the less chart bars can display information due to the limited number of intrabars that can be analyzed.
Volume delta
Volume delta is a measure that separates โvolumeโ into "up" and "down" parts, then takes the difference to estimate the net demand for the asset. This approach gives traders a more detailed insight when analyzing volumeโ and market sentiment. There are several methods for determining whether an asset's volumeโ belongs in the "up" or "down" category. Some indicators, such as On Balance Volumeโ and the Klinger Oscillator , use the change in price between bars to assign โvolumeโ values to the appropriate category. Others, such as Chaikin Money Flow , make assumptions based on open, high, low, and close prices. The most accurate method involves using tick data to determine whether each transaction occurred at the bid or ask price and assigning the โvolumeโ value to the appropriate category accordingly. However, this method requires a large amount of data on historical bars, which can limit the historical depth of charts and the number of symbols for which tick data is available.
In the context where historical tick data is not yet available on TradingView, intrabar analysis is the most precise technique to calculate โvolume delta on historical bars on our charts. This indicator uses intrabar analysis to achieve a compromise between simplicity and accuracy in calculating โvolume delta on historical bars. Our Volume Profile indicators use it as well. Other โvolume delta indicators in our Community Scripts , such as the Realtime 5D Profile , use real-time chart updates to achieve more precise โvolume delta calculations. However, these indicators aren't suitable for analyzing historical bars since they only work for real-time analysis.
This is the logic we use to assign intrabar โvolume to the "up" or "down" category:
โโข If the intrabar's open and close values are different, their relative position is used.
โโข If the intrabar's open and close values are the same, the difference between the intrabar's close and the previous intrabar's close is used.
โโข As a last resort, when there is no movement during an intrabar and it closes at the same price as the previous intrabar, the last known polarity is used.
Once all intrabars comprising a chart bar are analyzed, we calculate the net difference between "up" and "down" intrabar volumeโ to produce the volumeโ delta for the chart bar.
โ โ FEATURES
CVD resets
The "cumulative" part of the indicator's name stems from the fact that calculations accumulate during a period of time. By periodically resetting the volumeโ delta accumulation, we can analyze the progression of โvolume delta across manageable chunks, which is often more useful than looking at โvolume delta accumulated from the beginning of a chart's history.
You can configure the reset period using the "CVD Resets" input, which offers the following selections:
โโข None : Calculations do not reset.
โโข On a fixed higher timeframe : Calculations reset on the higher timeframe you select in the "Fixed higher timeframe" field.
โโข At a fixed time that you specify.
โโข At the beginning of the regular session .
โโข On trend changes : Calculations reset on the direction change of either the Aroon indicator, Parabolic SAR , or Supertrend .
โโข On a stepped higher timeframe : Calculations reset on a higher timeframe automatically stepped using the chart's timeframe and following these rules:
Chart TF โHTF
< 1min 1H
< 3H 1D
<= 12H 1W
< 1W 1M
>= 1W 1Y
Specifying intrabar precision
Ten options are included in the script to control the number of intrabars used per chart bar for calculations. The greater the number of intrabars per chart bar, the fewer chart bars can be analyzed.
The first five options allow users to specify the approximate amount of chart bars to be covered:
โโข Least Precise (Most chart bars) : Covers all chart bars by dividing the current timeframe by four.
โโThis ensures the highest level of intrabar precision while achieving complete coverage for the dataset.
โโข Less Precise (Some chart bars) & More Precise (Less chart bars) : These options calculate a stepped โLTF in relation to the current chart's timeframe.
โโข Very precise (2min intrabars) : Uses the second highest quantity of intrabars possible with the 2min โLTF.
โโข Most precise (1min intrabars) : Uses the maximum quantity of intrabars possible with the 1min โLTF.
The stepped lower timeframe for "Less Precise" and "More Precise" options is calculated from the current chart's timeframe as follows:
Chart Timeframe Lower Timeframe
Less Precise More Precise
< 1hr 1min 1min
< 1D 15min 1min
< 1W โ2hrโ 30min
> 1W 1D 60min
The last five options allow users to specify an approximate fixed number of intrabars to analyze per chart bar. The available choices are 12, 24, 50, 100, and 250. The script will calculate the LTFโ which most closely approximates the specified number of intrabars per chart bar. Keep in mind that due to factors such as the length of a ticker's sessions and rounding of the LTFโ, it is not always possible to produce the exact number specified. However, the script will do its best to get as close to the value as possible.
As there is a limit to the number of intrabars that can be analyzed by a script, a tradeoff occurs between the number of intrabars analyzed per chart bar and the chart bars for which calculations are possible.
Display
This script displays raw or cumulative volumeโ delta values on the chart as either line or histogram oscillator zones scaled according to the price chart, allowing traders to visualize volumeโ activity on each bar or cumulatively over time. The indicator's background shows where CVDโ resets occur, demarcating the beginning of new zones. The vertical axis of each oscillator zone is scaled relative to the one with the highest price range, and the oscillator values are scaled relative to the highest volumeโ delta. A vertical offset is applied to each oscillator zone so that the highest oscillator value aligns with the lowest price. This method ensures an accurate, intuitive visual comparison of volumeโ activity within zones, as the scale is consistent across the chart, and oscillator values sit below prices. The vertical scale of oscillator zones can be adjusted using the "Zone Height" input in the script settings.
This script displays labels at the highest and lowest oscillator values in each zone, which can be enabled using the "Hi/Lo Labels" input in the "Visuals" section of the script settings. Additionally, the oscillator's value on a chart bar is displayed as a tooltip when a user hovers over the bar, which can be enabled using the "Value Tooltips" input.
Divergences occur when the polarity of โvolume delta does not match that of the chart bar. The script displays divergences as bar colors and background colors that can be enabled using the "Color bars on divergences" and "Color background on divergences" inputs.
An information box in the lower-left corner of the indicator displays the HTF used for resets, the โLTF used for intrabars, the average quantity of intrabars per chart bar, and the number of chart bars for which there is LTF data. This is enabled using the "Show information box" input in the "Visuals" section of the script settings.
FOR Pine Scriptโข CODERS
โโข This script utilizes `ltf()` and `ltfStats()` from the lower_tf library.
โโThe `ltf()` function determines the appropriate lower timeframe from the selected calculation mode and chart timeframe, and returns it in a format that can be used with request.security_lower_tf() .
โโThe `ltfStats()` function, on the other hand, is used to compute and display statistical information about the lower timeframe in an information box.
โโข The script utilizes display.data_window and display.status_line to restrict the display of certain plots.
โโThese new built-ins allow coders to fine-tune where a scriptโs plot values are displayed.
โโข The newly added session.isfirstbar_regular built-in allows for resetting the โCVD segments at the start of the regular session.
โโข The VisibleChart library developed by our resident PineCoders team leverages the chart.left_visible_bar_time and chart.right_visible_bar_time variables to optimize the performance of this script.
โโThese variables identify the opening time of the leftmost and rightmost visible bars on the chart, allowing the script to recalculate and draw objects only within the range of visible bars as the user scrolls.
โโThis functionality also enables the scaling of the oscillator zones.
โโThese variables are just a couple of the many new built-ins available in the chart.* namespace.
โโFor more information, check out this blog post or look them up by typing "chart." in the Pine Scriptโข Reference Manual .
โโข Our ta library has undergone significant updates recently, including the incorporation of the `aroon()` indicator used as a method for resetting โCVD segments within this script.
โโRevisit the library to see more of the newly added content!
Look first. Then leap.
Bitcoin Stalemate IndicatorThe Bitcoin Stalemate Indicator examines periods in the market defined by a combination of high volume and low price volatility. These periods are a bit like a tug-of-war with both sides applying a lot of force but the rope moving very little. Periods of high volume and low volatility suggest both sides of the trade are stuck in a stalemate. This indicator may be useful in identifying psychologically important price levels.
The mechanics of the indicator are fairly simple: the indicator takes the volume and divides it by the candleโs size over itโs close for that same period.
volume / ((high - low) / close)
Candles that move very little but with high volume will produce higher reads and vice versa. Finally a smoothing average is applied to clean up the noise.
Volume profiles from the top 6 exchanges are averaged in order to avoid a single exchangeโs popularity acting as an overriding factor. Single exchanges can be isolated but are of lesser use. Heat map functionality is only active when all exchanges are selected.
Market Profile Fixed ViewSome instruments does not provide any volume information, therefore, as a fixed volume profile user, I needed a fixed market profile indicator to use the same principles, regardless of whether the volumes are available or not.
This script draws a market profile histogram corresponding to price variations within a specific duration, you only need to specify Start and End date/time values to see the histogram on your chart.
Details
Two lines corresponding to highest/lowest prices are displayed around the histogram
The redline corresponds to the POC (point of control)
Options
Start calculation
End calculation
Bars number (histogram resolution, currently locked to a max value of 50 bars)
Display side/Width (allows to modify size of bars, to the left or to the right)
Bars/Borders/POC Color customization
Notes
This script will probably be updated (to add VAH/VAL zones, and maybe other options). However, some common market profile attributes have not been implemented yet since I don't really use them)
Bar Balance [LucF]Bar Balance extracts the number of up, down and neutral intrabars contained in each chart bar, revealing information on the strength of price movement. It can display stacked columns representing raw up/down/neutral intrabar counts, or an up/down balance line which can be calculated and visualized in many different ways.
WARNING: This is an analysis tool that works on historical bars only. It does not show any realtime information, and thus cannot be used to issue alerts or for automated trading. When realtime bars elapse, the indicator will require a browser refresh, a change to its Inputs or to the chart's timeframe/symbol to recalculate and display information on those elapsed bars. Once a trader understands this, the indicator can be used advantageously to make discretionary trading decisions.
Traders used to work with myโ DeltaโVolumeโColumnsโPro โwill feel right at home in this indicator's Inputs . It has lots of options, allowing it to be used in many different ways. If you value the bar balance information this indicator mines, I hope you will find the time required to master the use of Bar Balance well worth the investment.
โโ OVERVIEW
The indicator has two modes: Columns and Line .
Columns
โข In Columns mode you can display stacked Up/Down/Neutral columns.
โข The "Up" section represents the count of intrabars where `close > open`, "Down" where `close < open` and "Neutral" where `close = open`.
โข The Up section always appears above the centerline, the Down section below. The Neutral section overlaps the centerline, split halfway above and below it.
โThe Up and Down sections start where the Neutral section ends, when there is one.
โข The Up and Down sections can be colored independently using 7 different methods.
โข The signal line plotted in Line mode can also be displayed in Columns mode.
Line
โข Displays a single balance line using a zero centerline.
โข A variable number of independent methods can be used to calculate the line (6), determine its color (5), and color the fill (5).
โYou can thus evaluate the state of 3 different components with this single line.
โข A "Divergence Levels" feature will use the line to automatically draw expanding levels on divergence events.
Features available in both modes
โข The color of all components can be selected from 15 base colors, with 16 gradient levels used for each base color in the indicator's gradients.
โข A zero line can show a 6-state aggregate value of the three main volume balance modes.
โข The background can be colored using any of 5 different methods.
โข Chart bars can be colored using 5 different methods.
โข Divergence and large neutral count ratio events can be shown in either Columns or Line mode, calculated in one of 4 different methods.
โข Markers on 6 different conditions can be displayed.
โโ CONCEPTS
Intrabar inspection
Intrabar inspection means the indicator looks at lower timeframe bars ( intrabars ) making up a given chart bar to gather its information. If your chart is on a 1-hour timeframe and the intrabar resolution determined by the indicator is 5 minutes, then 12 intrabars will be analyzed for each chart bar and the count of up/down/neutral intrabars among those will be tallied.
Bar Balances and calculation methods
The indicator uses a variety of methods to evaluate bar balance and to derive other calculations from them:
1. Balance on Bar : Uses the relative importance of instant Up and Down counts on the bar.
2. Balance Averages : Uses the difference between the EMAs of Up and Down counts.
3. Balance Momentum : Starts by calculating, separately for both Up and Down counts, the difference between the same EMAs used in Balance Averages and an SMA of double the period used for the EMAs. These differences are then aggregated and finally, a bounded momentum of that aggregate is calculated using RSI.
4. Markers Bias : It sums the bull/bear occurrences of the four previous markers over a user-defined period (the default is 14).
5. Combined Balances : This is the aggregate of the instant bull/bear bias of the three main bar balances.
6. Dual Up/Down Averages : This is a display mode showing the EMA calculated for each of the Up and Down counts.
Interpretation of neutral intrabars
What do neutral intrabars mean? When price does not change during a bar, it can be because there is simply no interest in the market, or because of a perfect balance between buyers and sellers. The latter being more improbable, Bar Balance assumes that neutral bars reveal a lack of interest, which entails uncertainty. That is the reason why the option is provided to interpret ratios of neutral intrabars greater than 50% as divergences. It is also the rationale behind the option to dampen signal lines on the inverse ratio of neutral intrabars, so that zero intrabars do not affect the signal, and progressively larger proportions of neutral intrabars will reduce the signal's amplitude, as the balance calcs using the up/down counts lose significance. The impact of the dampening will vary with markets. Weaker markets such as cryptos will often contain greater numbers of neutral intrabars, so dampening the Line in that sector will have a greater impact than in more liquid markets.
โโ FEATURES
1 โ Columns
โข While the size of the Up/Down columns always represents their respective importance on the bar, their coloring mode is independent. The default setup uses a standard coloring mode where the Up/Down columns over/under the zero line are always in the bull/bear color with a higher intensity for the winning side. Six other coloring modes allow you to pack more information in the columns. When choosing to color the top columns using a bull/bear gradient on Balance Averages, for example, you will end up with bull/bear colored tops. In order for the color of the bottom columns to continue to show the instant bar balance, you can then choose the "Up/Down Ratio on Bar โ Dual Solid Colors" coloring mode to make those bars the color of the winning side for that bar.
โข Line mode shows only the line, but Columns mode allows displaying the line along with it. If the scale of the line is different than that of the scale of the columns, the line will often appear flat. Traders may find even a flat line useful as its bull/bear colors will be easily distinguishable.
2 โ Line
โข The default setup for Line mode uses a calculation on "Balance Momentum", with a fill on the longer-term "Balance Averages" and a line color based on the "Markers Bias". With the background set on "Line vs Divergence Levels" and the zero line on the hard-coded "Combined Bar Balances", you have access to five distinct sources of information at a glance, to which you can add divergences, divergences levels and chart bar coloring. This provides powerful potential in displaying bar balance information.
โข When no columns are displayed, Line mode can show the full scale of whichever line you choose to calculate because the columns' scale no longer interferes with the line's scale.
โข Note that when "Balance on Bar" is selected, the Neutral count is also displayed as a ratio of the balance line. This is the only instance where the Neutral count is displayed in Line mode.
โข The "Dual Up/Down Averages" is an exception as it displays two lines: one average for the Up counts and another for the Down counts. This mode will be most useful when Columns are also displayed, as it provides a reference for the top and bottom columns.
3 โ Zero Line
The zero line can be colored using two methods, both based on the Combined Balances, i.e., the aggregate of the instant bull/bear bias of the three main bar balances.
โข In "Six-state Dual Color Gradient" mode, a dot appears on every bar. Its color reflects the bull/bear state of the Combined Balances, and the dot's brightness reflects the tally of balance biases.
โข In "Dual Solid Colors (All Bull/All Bear Only)" a dot only appears when all three balances are either bullish or bearish. The resulting pattern is identical to that of Marker 1.
4 โ Divergences
โข Divergences are displayed as a small circle at the top of the scale. Four different types of divergence events can be detected. Divergences occur whenever the bull/bear bias of the method used diverges with the bar's price direction.
โข An option allows you to include in divergence events instances where the count of neutral intrabars exceeds 50% of the total intrabar count.
โข The divergence levels are dynamic levels that automatically build from the line's values on divergence events. On consecutive divergences, the levels will expand, creating a channel. This implementation of the divergence levels corresponds to my view that divergences indicate anomalies, hesitations, points of uncertainty if you will. It excludes any association of a pre-determined bullish/bearish bias to divergences. Accordingly, the levels merely take note of divergence events and mark those points in time with levels. Traders then have a reference point from which they can evaluate further movement. The bull/bear/neutral colors used to plot the levels are also congruent with this view in that they are determined by price's position relative to the levels, which is how I think divergences can be put to the most effective use.
5 โ Background
โข The background can show a bull/bear gradient on four different calculations. You can adjust its brightness to make its visual importance proportional to how you use it in your analysis.
6 โ Chart bars
โข Chart bars can be colored using five different methods.
โข You have the option of emptying the body of bars where volume does not increase, as does my TLD indicator, the idea behind this being that movement on bars where volume does not increase is less relevant.
7 โ Intrabar Resolution
You can choose between three modes. Two of them are automatic and one is manual:
โโa) Fast, Longer history, Auto-Steps (~12 intrabars) : Optimized for speed and deeper history. Uses an average minimum of 12 intrabars.
โโb) More Precise, Shorter History Auto-Steps (~24 intrabars) : Uses finer intrabar resolution. It is slower and provides less history. Uses an average minimum of 24 intrabars.
โโc) Fixed : Uses the fixed resolution of your choice.
Auto-Steps calculations vary for 24/7 and conventional markets in order to achieve the proper target of minimum intrabars.
You can choose to view the intrabar resolution currently used to calculate delta volume. It is the default.
The proper selection of the intrabar resolution is important. It must achieve maximal granularity to produce precise results while not unduly slowing down calculations, or worse, causing runtime errors.
8 โ Markers
Six markers are available:
1. Combined Balances Agreement : All three Bar Balances are either bullish or bearish.
2. Up or Down % Agrees With Bar : An up marker will appear when the percentage of up intrabars in an up chart bar is greater than the specified percentage. Conditions mirror to down bars.
3. Divergence confirmations By Price : One of the four types of balance calculations can be used to detect divergences with price. Confirmations occur when the bar following the divergence confirms the balance bias. Note that the divergence events used here do not include neutral intrabar events.
4. Balance Transitions : Bull/bear transitions of the selected balance.
5. Markers Bias Transitions : Bull/bear transitions of the Markers Bias.
6. Divergence Confirmations By Line : Marks points where the line first breaches a divergence level.
Markers appear when the condition is detected, without delay. Since nothing is plotted in realtime, markers do not appear on the realtime bar.
9 โ Settings
โข Two modes can be selected to dampen the line on the ratio of neutral intrabars.
โข A distinct weight can be attributed to the count of the latter half of intrabars, on the assumption that later intrabars may be more important in determining the outcome of chart bars.
โข Allows control over the periods of the different moving averages used in calculations.
โข The default periods used for the various calculations define the following hierarchy from slow to fast:
โโBalance Averages: 50,
โโBalance Momentum: 20,
โโDual Up/Down Averages: 20,
โโMarker Bias: 10.
โโ LIMITATIONS
โข This script uses a special characteristic of the `security()` function allowing the inspection of intrabarsโwhich is not officially supported by TradingView.
โข The method used does not work on the realtime barโonly on historical bars.
โข The indicator only works on some chart resolutions: 3, 5, 10, 15 and 30 minutes, 1, 2, 4, 6, and 12 hours, 1 day, 1 week and 1 month. The scriptโs code can be modified to run on other resolutions, but chart resolutions must be divisible by the lower resolution used for intrabars and the stepping mechanism could require adaptation.
โข When using the "Line vs Divergence Levels โ Dual Color Gradient" color mode to fill the line, background or chart bars, keep in mind that a line calculation mode must be defined for it to work, as it determines gradients on the movement of the line relative to divergence levels. If the line is hidden, it will not work.
โข When the difference between the chartโs resolution and the intrabar resolution is too great, runtime errors will occur. The Auto-Steps selection mechanisms should avoid this.
โข Alerts do not work reliably when `security()` is used at intrabar resolutions. Accordingly, no alerts are configured in the indicator.
โข The color model used in the indicator provides for fancy visuals that come at a price; when you change values in Inputs , it can take 20 seconds for the changes to materialize. Luckily, once your color setup is complete, the color model does not have a large performance impact, as in normal operation the `security()` calls will become the most important factor in determining response time. Also, once in a while a runtime error will occur when you change inputs. Just making another change will usually bring the indicator back up.
โโ RAMBLINGS
Is this thing useful?
I'll let you decide. Bar Balance acts somewhat like an X-Ray on bars. The intrabars it analyzes are no secret; one can simply change the chart's resolution to see the same intrabars the indicator uses. What the indicator brings to traders is the precise count of up/down/neutral intrabars and, more importantly, the calculations it derives from them to present the information in a way that can make it easier to use in trading decisions.
How reliable is Bar Balance information?
By the same token that an up bar does not guarantee that more up bars will follow, future price movements cannot be inferred from the mere count of up/down/neutral intrabars. Price movement during any chart bar for which, let's say, 12 intrabars are analyzed, could be due to only one of those intrabars. One can thus easily see how only relying on bar balance information could be very misleading. The rationale behind Bar Balance is that when the information mined for multiple chart bars is aggregated, it can provide insight into the history behind chart bars, and thus some bias as to the strength of movements. An up chart bar where 11/12 intrabars are also up is assumed to be stronger than the same up bar where only 2/12 intrabars are up. This logic is not bulletproof, and sometimes Bar Balance will stray. Also, keep in mind that balance lines do not represent price momentum as RSI would. Bar Balance calculations have no idea where price is. Their perspective, like that of any historian, is very limited, constrained that it is to the narrow universe of up/down/neutral intrabar counts. You will thus see instances where price is moving up while Balance Momentum, for example, is moving down. When Bar Balance performs as intended, this indicates that the rally is weakening, which does necessarily imply that price will reverse. Occasionally, price will merrily continue to advance on weakening strength.
Divergences
Most of the divergence detection methods used here rely on a difference between the bias of a calculation involving a multi-bar average and a given bar's price direction. When using "Bar Balance on Bar" however, only the bar's balance and price movement are used. This is the default mode.
As usual, divergences are points of interest because they reveal imbalances, which may or may not become turning points. I do not share the overwhelming enthusiasm traders have for the purported ability of bullish/bearish divergences to indicate imminent reversals.
Superfluity
In "The Bed of Procrustes", Nassim Nicholas Taleb writes: To bankrupt a fool, give him information . Bar Balance can display lots of information. While learning to use a new indicator inevitably requires an adaptation period where we put it through its paces and try out all its options, once you have become used to Bar Balance and decide to adopt it, rigorously eliminate the components you don't use and configure the remaining ones so their visual prominence reflects their relative importance in your analysis. I tried to provide flexible options for traders to control this indicator's visuals for that exact reasonโnot for window dressing.
โโ NOTES
For traders
โข To avoid misleading traders who don't read script descriptions, the indicator shows nothing in the realtime bar.
โข The Data Window shows key values for the indicator.
โข All gradients used in this indicator determine their brightness intensities using advances/declines in the signalโnot their relative position in a fixed scale.
โข Note that because of the way gradients are optimized internally, changing their brightness will sometimes require bringing down the value a few steps before you see an impact.
โข Because this indicator does not use volume, it will work on all markets.
For coders
โข For those interested in gradients, this script uses an advanced version of the Advance/Decline gradient function from the PineCoders Color Gradient (16 colors) Framework . It allows more precise control over the range, steps and min/max values of the gradients.
โข I use the PineCoders Coding Conventions for Pine to write my scripts.
โข I used functions modified from the PineCoders MTF Selection Framework for the selection of timeframes.
โโ THANKS TO:
โ alexgrover who helped me think through the dampening method used to attenuate signal lines on high ratios of neutral intrabars.
โ A guy called Kuan who commented on a Backtest Rookies presentation of their Volume Profile indicator . The technique I use to inspect intrabars is derived from Kuan's code.
โ theheirophant , my partner in the exploration of the sometimes weird abysses of `security()`โs behavior at intrabar resolutions.
โ midtownsk8rguy , my brilliant companion in mining the depths of Pine graphics. He is also the co-author of the PineCoders Color Gradient Frameworks .
Volume Voids [theUltimator5]Volume Voids highlights price regions with no or unusually thin participation over a chosen lookback. It bins the lookbackโs full price range into equal steps, assigns each barโs close to a bin, and accumulates volume per bin. Contiguous runs of zero-volume bins are shown as โvoids,โ while low-volume runs (below a dynamic threshold) mark thin-liquidity โcorridorsโ where price often traverses quickly when revisited.
An optional PoC (Point of Control) line marks the mid-price of the highest-volume binโcommonly treated as a recent โvalueโ area that price may revisit.
What it draws on your chart
Histogram (optional): Right-anchored horizontal volume-by-price bars built from your lookback and bin count. Bars tint greenโred via a simple delta proxy (up-bar volume minus down-bar volume) to hint at directional participation inside each price band.
Point of Control (optional): A horizontal line at the highest-volume binโs mid-price (the PoC).
Zero-Volume Voids: Translucent boxes where no bin volume printed within the window (detected between the first and last non-empty bins ).
Low-Volume Zones: Translucent boxes where bin volume is below a dynamic threshold (see formula below), often acting like low-friction corridors.
How it works
Slice the lookbackโs highโlow into N equal price bins.
Assign each barโs closing price to a bin and add that barโs volume to the bin total. A simple up/down-bar delta proxy drives the histogramโs tinting.
PoC = bin with the maximum accumulated volume.
Zero-Volume Voids = contiguous runs of bins with exactly zero volume (bounded by the first/last occupied bins).
Low-Volume Zones = contiguous runs of bins with volume below:
threshold = total_window_volume รท (divisor ร number_of_bins)
Lower divisor โ more LV boxes; higher divisor โ stricter/fewer boxes.
Note: This is a lightweight, chart-native approximation of a volume profile. Volume is binned by bar close (not by tick-level prints or intrabar distribution), so โvoidsโ/โthinโ areas reflect this approximation.
Key inputs
Lookback Period: Window for calculations.
Number of Volume Boxes (bins): Histogram resolution.
PoC / Show Histogram / Anchor to Right Side: Visibility and layout controls.
Low-Volume Threshold Divisor: Sensitivity for LV detection.
Colors & Labels: Customize zero-volume / low-volume box colors and optional labels with offsets.
How to use (educational, not signals)
Context: High-volume = acceptance; thin/zero-volume = inefficiency. Price often rotates near acceptance and moves faster through thin areas.
Revisits: On returns to prior voids/LV zones, watch for accelerated moves or fills; PoC can serve as a balance reference.
Confluence: Pair with trend tools (e.g., ADX), VWAP/session markers, or structure levels for timing and risk.
Limitations & performance
Bins use closing price only; intrabar distribution is not modeled.
Detections refresh on the live bar; visuals can be heavy on large lookbacks/high bin countsโreduce bins/lookback or hide labels if needed.
Technical Summary VWAP | RSI | VolatilityTechnical Summary VWAP | RSI | Volatility
The Quantum Trading Matrix is a multi-dimensional market-analysis dashboard designed as an educational and idea-generation tool to help traders read price structure, participation, momentum and volatility in one compact view. It is not an automated execution system; rather, it aggregates lightweight โquantumโ signals โ VWAP position, momentum oscillator behaviour, multi-EMA trend scoring, volume flow and institutional activity heuristics, market microstructure pivots and volatility measures โ and synthesizes them into a single, transparent score and signal recommendation. The primary goal is to make explicit why a given market looks favourable or unfavourable by showing the individual ingredients and how they combine, enabling traders to learn, test and form rules based on observable market mechanics.
Each module of the matrix answers a distinct market question. VWAP and its percentage distance indicate whether the current price is trading above or below the intraday volume-weighted average โ a proxy for intraday institutional control and value. The quantum momentum oscillator (fast and slow EMA difference scaled to percent) captures short-to-intermediate momentum shifts, providing a quickly responsive view of directional pressure. Multi-EMA trend scoring (8/21/50) produces a simple, transparent trend score by counting conditions such as price above EMAs and cross-EMAs ordering; this score is used to categorize market trend into descriptive buckets (e.g., STRONG UP, WEAK UP, NEUTRAL, DOWN). Volume analysis compares current volume to a recent moving average and computes a Z-score to detect spikes and unusual participation; additional buy/sell pressure heuristics (buyingPressure, sellingPressure, flowRatio) estimate whether upside or downside participation dominates the bar. Institutional activity is approximated by flagging large orders relative to volume baseline (e.g., volume > 2.5ร MA) and estimating a dark pool proxy; this is a heuristic to highlight bars that likely had large players involved.
The dashboard also performs market-structure detection with small pivot windows to identify recent local support/resistance areas and computes price position relative to the daily high/low (dailyMid, pricePosition). Volatility is measured via ATR divided by price and bucketed into LOW/NORMAL/HIGH/EXTREME categories to help you adapt stop sizing and expectational horizons. Finally, all these pieces feed an interpretable scoring function that rewards alignment: VWAP above, strong flow ratio, bullish trend score, bullish momentum, and favorable RSI zone add to the overall score which is presented as a 0โ100 metric and a colored emoji indicator for at-a-glance assessment.
The mashup is purposeful: each indicator covers a failure mode of the other. For example, momentum readings can be misleading during volatility spikes; VWAP informs whether institutions are on the bid or offer; volume Z-score detects abnormal participation that can validate a breakout; multi-EMA score mitigates single-EMA whipsaws by requiring a combination of price/EMA conditions. Combining these signals increases information content while keeping each component explainable โ a key compliance requirement. The script intentionally emphasizes transparency: when it shows a BUY/SELL/HOLD recommendation, the dashboard shows the underlying sub-components so a trader can see whether VWAP, momentum, volume, trend or structure primarily drove the score.
For practical use, adopt a clear workflow: (1) check the matrix score and read the component tiles (VWAP position, momentum, trend and volume) to understand the drivers; (2) confirm market-structure support/resistance and pricePosition relative to the daily range; (3) require at least two corroborating components (for example, VWAP ABOVE + Momentum BULLISH or Volume spike + Trend STRONG UP) before considering entries; (4) use ATR-based stops or daily pivot distance for stop placement and size positions such that the trade risks a small, pre-defined percent of capital; (5) for intraday scalps shorten holding time and tighten stops, for swing trades increase lookback lengths and require multi-timeframe (higher TF) agreement. Treat the matrix as an idea filter and replay lab: when an alert triggers, replay the bars and observe which components anticipated the move and which lagged.
Parameter tuning matters. Shortening the momentum length makes the oscillator more sensitive (useful for scalping), while lengthening it reduces noise for swing contexts. Volume profile bars and MA length should match the instrumentโs liquidity โ increase the MA for low-liquidity stocks to reduce false institutional flags. The trend multiplier and signal sensitivity parameters let you calibrate how aggressively the matrix counts micro evidence into the score. Always backtest parameter sets across multiple periods and instruments; run walk-forward tests and keep a simple out-of-sample validation window to reduce overfitting risk.
Limitations and failure modes are explicit: institutional flags and dark-pool estimates are heuristics and cannot substitute for true tape or broker-level order flow; volume split by price range is an approximation and will not perfectly reflect signed volume; pivot detection with small windows may miss larger structural swings; VWAP is typically intraday-centric and less meaningful across multi-day swing contexts; the score is additive and may not capture non-linear relationships between features in extreme market regimes (e.g., flash crashes, circuit breaker events, or overnight gaps). The matrix is also susceptible to false signals during major news releases when price and volume behavior dislocate from typical patterns. Users should explicitly test behavior around earnings, macro data and low-liquidity periods.
To learn with the matrix, perform these experiments: (A) collect all BUY/SELL alerts over a 6-month period and measure median outcome at 5, 20 and 60 bars; (B) require additional gating conditions (e.g., only accept BUY when flowRatio>60 and trendScoreโฅ4) and compare expectancy; (C) vary the institutional threshold (2ร, 2.5ร, 3ร volumeMA) to see how many true positive spikes remain; (D) perform multi-instrument tests to ensure parameters are not tuned to a single ticker. Document every test and prefer robust, slightly lower returns with clearer logic rather than tuned โoptimalโ results that fail out of sample.
Originality statement: This scriptโs originality lies in the curated combination of intraday value (VWAP), multi-EMA trend scoring, momentum percent oscillator, volume Z-score plus buy/sell flow heuristics and a compact, interpretable scoring system. The script is not a simple indicator mashup; it is a didactic ensemble specifically designed to make internal rationale visible so traders can learn how each market characteristic contributes to actionable probability. The toolโs novelty is its emphasis on interpretability โ showing the exact contributing signals behind a composite score โ enabling reproducible testing and educational value.
Finally, for TradingView publication, include a clear description listing the modules, a short non-technical summary of how they interact, the tunable inputs, limitations and a risk disclaimer. Remove any promotional content or external contact links. If you used trademark symbols, either provide registration details or remove them. This transparent documentation satisfies TradingViewโs requirement that mashups justify their composition and teach users how to use them.
Quantum Trading Matrix โ multi-factor intraday dashboard (educational use only).
Purpose: Combines intraday VWAP position, a fast/slow EMA momentum percent oscillator, multi-EMA trend scoring (8/21/50), volume Z-score and buy/sell flow heuristics, pivot-based microstructure detection, and ATR-based volatility buckets to produce a transparent, componentized market score and trade-idea indicator. The mashup is intentional: VWAP identifies intraday value, momentum detects short bursts, EMAs provide structural trend bias, and volume/flow confirm participation. Signals require alignment of at least two components (for example, VWAP ABOVE + Momentum BULLISH + positive flow) for higher confidence.
Inputs: momentum period, volume MA/profile length, EMA configuration (8/21/50), trend multiplier, signal sensitivity, color and display options. Use shorter momentum lengths for scalps and longer for swing analysis. Increase volume MA for thinly traded instruments.
Limitations: Institutional/dark-pool estimates and flow heuristics are approximations, not actual exchange tape. VWAP is intraday-focused. Expect false signals during major news or low-liquidity sessions. Backtest and paper-trade before applying real capital.
Risk Disclaimer: For education and analysis only. Not financial advice. Use proper risk management. The author is not responsible for trading losses.
________________________________________
Risk & Misuse Disclaimer
This indicator is provided for education, analysis and idea generation only. It is not investment or financial advice and does not guarantee profits. Institutional activity flags, dark-pool estimates and flow heuristics are approximations and should not be treated as exchange tape. Backtest thoroughly and use demo/paper accounts before trading real capital. Always apply appropriate position sizing and stop-loss rules. The author is not responsible for any trading losses resulting from the use or misuse of this tool.
________________________________________
Risk Disclaimer: This tool is provided for education and analysis only. It is not financial advice and does not guarantee returns. Users assume all risk for trades made based on this script. Back test thoroughly and use proper risk management.
Anchored Grids ft. VolumeINTRO
The 'Volume Profile' is a great tool, isnโt it? It shows us where volume has accumulated on the chart and helps guide trading decisions. The only catch is that we canโt really choose the levelsโitโs all based on where volume happens to cluster. But what if we reversed the logic and measured the volume at the levels we define? Thatโs exactly what this script does, giving you a fresh way to spot support and resistance :)
OVERVIEW
'Anchored Grids ft. Volume' is a sophisticated technical analysis tool that combines price grid analysis with volume accumulation metrics. This indicator dynamically calculates and displays custom support and resistance levels based on a user-defined timeframe, while simultaneously tracking and visualizing volume accumulation at each specific price level. Unlike traditional volume profile indicators that use complex statistical clustering, this tool provides straightforward volume measurement at predetermined technical levels. It answers a critical question: "How much trading activity occurred near the key price levels I care about?".
HOW DOES THIS INDICATOR WORK?
This indicator builds a customizable grid system anchored to the opening price of any user-selected timeframe (hourly, daily, weekly, etc.). From that anchor point, it continuously tracks the highest high and lowest low, then calculates equidistant grid levels within that range. Two calculation modes are availableโArithmetic and Geometricโallowing flexibility in how the levels are distributed.
Once the grid is established, a volume accumulation engine comes into play. For each price bar, the script checks whether the barโs range intersects with any levelโs tolerance zone (default 0.01%). If a touch is detected, that barโs volume is added to the corresponding level. Over time, this process builds a clear picture of where significant trading activity has clustered.
The visualization system highlights these dynamics by applying a color gradient based on volume intensity and adjusting line thickness proportional to accumulated volume. Each level is also labeled with four key data points:
The grid number (in square brackets)
The price of the level
The percentage distance between the level and the opening price of the selected timeframe
The total volume accumulated within the levelโs tolerance range
PARAMETERS
Timeframe: Defines the anchor period for grid calculation. Then, the indicator automatically determines the open, high, and low prices.
Mode: This option determines how the distance between levels is calculated: Arithmetic (linear) means equal price spacing between levels, while Geometric (logarithmic) means equal percentage spacing between levels.
Grids: It's the number of levels between high and low.
Color: Base color for grid lines and labels. When volume data is displayed, lower values are darkened by 50%.
Show Volume Accumulation: When this parameter is activated, the volume calculation is enabled.
Tolerance : The Tolerance parameter (default range: 0.01%) defines the price range around each grid level where volume accumulation is registered. It acts as a sensitivity control that determines how close price must be to a level to count trading volume toward that level's accumulation.
ORIGINALITY
Itโs possible to find comprehensive grid-drawing tools among community indicators, but I havenโt come across an example that combines this concept with volume data. More importantly, I wanted to demonstrate how volume accumulation can be generated for any data modeled as an array on the chart by developers.
SUMMARY
In conclusion, the selected timeframe and the number of grids are only used as a reference to determine where the levels are drawn. The true value of this indicator lies in its ability to calculate volume accumulation directly from the chartโs own candles, showing how much trading activity occurred around each level. The result is a hybrid framework that merges structural price analysis with volume distribution, offering traders deeper insights into where markets are likely to react.
NOTE
While powerful, this tool should be used as part of a comprehensive trading strategy rather than as a standalone system. Always combine with risk management principles and market context awareness. I hope it helps everyone. Trade as safely as possible. Best of luck!
Quantum Dip Hunter | AlphaNattQuantum Dip Hunter | AlphaNatt
๐ฏ Overview
The Quantum Dip Hunter is an advanced technical indicator designed to identify high-probability buying opportunities when price temporarily dips below dynamic support levels. Unlike simple oversold indicators, this system uses a sophisticated quality scoring algorithm to filter out low-quality dips and highlight only the best entry points.
"Buy the dip" - but only the right dips. Not all dips are created equal.
โก Key Features
5 Detection Methods: Choose from Dynamic, Fibonacci, Volatility, Volume Profile, or Hybrid modes
Quality Scoring System: Each dip is scored from 0-100% based on multiple factors
Smart Filtering: Only signals above your quality threshold are displayed
Visual Effects: Glow, Pulse, and Wave animations for the support line
Risk Management: Automatic stop-loss and take-profit calculations
Real-time Statistics: Live dashboard showing current market conditions
๐ How It Works
The indicator calculates a dynamic support line using your selected method
When price dips below this line, it evaluates the dip quality
Quality score is calculated based on: trend alignment (30%), volume (20%), RSI (20%), momentum (15%), and dip depth (15%)
If the score exceeds your minimum threshold, a buy signal arrow appears
Stop-loss and take-profit levels are automatically calculated and displayed
๐ Detection Methods Explained
Dynamic Support
Adapts to recent price action
Best for: Trending markets
Uses ATR-adjusted lowest points
Fibonacci Support
Based on 61.8% and 78.6% retracement levels
Best for: Pullbacks in strong trends
Automatically switches between fib levels
Volatility Support
Uses Bollinger Band methodology
Best for: Range-bound markets
Adapts to changing volatility
Volume Profile Support
Finds high-volume price levels
Best for: Identifying institutional support
Updates dynamically as volume accumulates
Hybrid Mode
Combines all methods for maximum accuracy
Best for: All market conditions
Takes the most conservative support level
โ๏ธ Key Settings
Dip Detection Engine
Detection Method: Choose your preferred support calculation
Sensitivity: Higher = more sensitive to price movements (0.5-3.0)
Lookback Period: How far back to analyze (20-200 bars)
Dip Depth %: Minimum dip size to consider (0.5-10%)
Quality Filters
Trend Filter: Only buy dips in uptrends when enabled
Minimum Dip Score: Quality threshold for signals (0-100%)
Trend Strength: Required trend score when filter is on
๐ Trading Strategies
Conservative Approach
Use Dynamic method with Trend Filter ON
Set minimum score to 80%
Risk:Reward ratio of 2:1 or higher
Best for: Swing trading
Aggressive Approach
Use Hybrid method with Trend Filter OFF
Set minimum score to 60%
Risk:Reward ratio of 1:1
Best for: Day trading
Scalping Setup
Use Volatility method
Set sensitivity to 2.0+
Focus on Target 1 only
Best for: Quick trades
๐จ Visual Customization
Color Themes:
Neon: Bright cyan/magenta for dark backgrounds
Ocean: Cool blues and teals
Solar: Warm yellows and oranges
Matrix: Classic green terminal look
Gradient: Smooth color transitions
Line Styles:
Solid: Clean, simple line
Glow: Adds depth with glow effect
Pulse: Animated breathing effect
Wave: Oscillating wave pattern
๐ก Pro Tips
Start with the Trend Filter ON to avoid catching falling knives
Higher quality scores (80%+) have better win rates but fewer signals
Use Volume Profile method near major support/resistance levels
Combine with your favorite momentum indicator for confirmation
The pulse animation can help draw attention to key levels
โ ๏ธ Important Notes
This indicator identifies potential entries, not guaranteed profits
Always use proper risk management
Works best on liquid instruments with good volume
Backtest your settings before live trading
Not financial advice - use at your own risk
๐ Statistics Panel
The live statistics panel shows:
Current detection method
Support level value
Trend direction
Distance from support
Current signal status
๐ค Support
Created by AlphaNatt
For questions or suggestions, please comment below!
Happy dip hunting! ๐ฏ
Not financial advice, always do your own research
real_time_candlesIntroduction
The Real-Time Candles Library provides comprehensive tools for creating, manipulating, and visualizing custom timeframe candles in Pine Script. Unlike standard indicators that only update at bar close, this library enables real-time visualization of price action and indicators within the current bar, offering traders unprecedented insight into market dynamics as they unfold.
This library addresses a fundamental limitation in traditional technical analysis: the inability to see how indicators evolve between bar closes. By implementing sophisticated real-time data processing techniques, traders can now observe indicator movements, divergences, and trend changes as they develop, potentially identifying trading opportunities much earlier than with conventional approaches.
Key Features
The library supports two primary candle generation approaches:
Chart-Time Candles: Generate real-time OHLC data for any variable (like RSI, MACD, etc.) while maintaining synchronization with chart bars.
Custom Timeframe (CTF) Candles: Create candles with custom time intervals or tick counts completely independent of the chart's native timeframe.
Both approaches support traditional candlestick and Heikin-Ashi visualization styles, with options for moving average overlays to smooth the data.
Configuration Requirements
For optimal performance with this library:
Set max_bars_back = 5000 in your script settings
When using CTF drawing functions, set max_lines_count = 500, max_boxes_count = 500, and max_labels_count = 500
These settings ensure that you will be able to draw correctly and will avoid any runtime errors.
Usage Examples
Basic Chart-Time Candle Visualization
// Create real-time candles for RSI
float rsi = ta.rsi(close, 14)
Candle rsi_candle = candle_series(rsi, CandleType.candlestick)
// Plot the candles using Pine's built-in function
plotcandle(rsi_candle.Open, rsi_candle.High, rsi_candle.Low, rsi_candle.Close,
"RSI Candles", rsi_candle.candle_color, rsi_candle.candle_color)
Multiple Access Patterns
The library provides three ways to access candle data, accommodating different programming styles:
// 1. Array-based access for collection operations
Candle candles = candle_array(source)
// 2. Object-oriented access for single entity manipulation
Candle candle = candle_series(source)
float value = candle.source(Source.HLC3)
// 3. Tuple-based access for functional programming styles
= candle_tuple(source)
Custom Timeframe Examples
// Create 20-second candles with EMA overlay
plot_ctf_candles(
source = close,
candle_type = CandleType.candlestick,
sample_type = SampleType.Time,
number_of_seconds = 20,
timezone = -5,
tied_open = true,
ema_period = 9,
enable_ema = true
)
// Create tick-based candles (new candle every 15 ticks)
plot_ctf_tick_candles(
source = close,
candle_type = CandleType.heikin_ashi,
number_of_ticks = 15,
timezone = -5,
tied_open = true
)
Advanced Usage with Custom Visualization
// Get custom timeframe candles without automatic plotting
CandleCTF my_candles = ctf_candles_array(
source = close,
candle_type = CandleType.candlestick,
sample_type = SampleType.Time,
number_of_seconds = 30
)
// Apply custom logic to the candles
float ema_values = my_candles.ctf_ema(14)
// Draw candles and EMA using time-based coordinates
my_candles.draw_ctf_candles_time()
ema_values.draw_ctf_line_time(line_color = #FF6D00)
Library Components
Data Types
Candle: Structure representing chart-time candles with OHLC, polarity, and visualization properties
CandleCTF: Extended candle structure with additional time metadata for custom timeframes
TickData: Structure for individual price updates with time deltas
Enumerations
CandleType: Specifies visualization style (candlestick or Heikin-Ashi)
Source: Defines price components for calculations (Open, High, Low, Close, HL2, etc.)
SampleType: Sets sampling method (Time-based or Tick-based)
Core Functions
get_tick(): Captures current price as a tick data point
candle_array(): Creates an array of candles from price updates
candle_series(): Provides a single candle based on latest data
candle_tuple(): Returns OHLC values as a tuple
ctf_candles_array(): Creates custom timeframe candles without rendering
Visualization Functions
source(): Extracts specific price components from candles
candle_ctf_to_float(): Converts candle data to float arrays
ctf_ema(): Calculates exponential moving averages for candle arrays
draw_ctf_candles_time(): Renders candles using time coordinates
draw_ctf_candles_index(): Renders candles using bar index coordinates
draw_ctf_line_time(): Renders lines using time coordinates
draw_ctf_line_index(): Renders lines using bar index coordinates
Technical Implementation Notes
This library leverages Pine Script's varip variables for state management, creating a sophisticated real-time data processing system. The implementation includes:
Efficient tick capturing: Samples price at every execution, maintaining temporal tracking with time deltas
Smart state management: Uses a hybrid approach with mutable updates at index 0 and historical preservation at index 1+
Temporal synchronization: Manages two time domains (chart time and custom timeframe)
The tooltip implementation provides crucial temporal context for custom timeframe visualizations, allowing users to understand exactly when each candle formed regardless of chart timeframe.
Limitations
Custom timeframe candles cannot be backtested due to Pine Script's limitations with historical tick data
Real-time visualization is only available during live chart updates
Maximum history is constrained by Pine Script's array size limits
Applications
Indicator visualization: See how RSI, MACD, or other indicators evolve in real-time
Volume analysis: Create custom volume profiles independent of chart timeframe
Scalping strategies: Identify short-term patterns with precisely defined time windows
Volatility measurement: Track price movement characteristics within bars
Custom signal generation: Create entry/exit signals based on custom timeframe patterns
Conclusion
The Real-Time Candles Library bridges the gap between traditional technical analysis (based on discrete OHLC bars) and the continuous nature of market movement. By making indicators more responsive to real-time price action, it gives traders a significant edge in timing and decision-making, particularly in fast-moving markets where waiting for bar close could mean missing important opportunities.
Whether you're building custom indicators, researching price patterns, or developing trading strategies, this library provides the foundation for sophisticated real-time analysis in Pine Script.
Implementation Details & Advanced Guide
Core Implementation Concepts
The Real-Time Candles Library implements a sophisticated event-driven architecture within Pine Script's constraints. At its heart, the library creates what's essentially a reactive programming framework handling continuous data streams.
Tick Processing System
The foundation of the library is the get_tick() function, which captures price updates as they occur:
export get_tick(series float source = close, series float na_replace = na)=>
varip float price = na
varip int series_index = -1
varip int old_time = 0
varip int new_time = na
varip float time_delta = 0
// ...
This function:
Samples the current price
Calculates time elapsed since last update
Maintains a sequential index to track updates
The resulting TickData structure serves as the fundamental building block for all candle generation.
State Management Architecture
The library employs a sophisticated state management system using varip variables, which persist across executions within the same bar. This creates a hybrid programming paradigm that's different from standard Pine Script's bar-by-bar model.
For chart-time candles, the core state transition logic is:
// Real-time update of current candle
candle_data := Candle.new(Open, High, Low, Close, polarity, series_index, candle_color)
candles.set(0, candle_data)
// When a new bar starts, preserve the previous candle
if clear_state
candles.insert(1, candle_data)
price.clear()
// Reset state for new candle
Open := Close
price.push(Open)
series_index += 1
This pattern of updating index 0 in real-time while inserting completed candles at index 1 creates an elegant solution for maintaining both current state and historical data.
Custom Timeframe Implementation
The custom timeframe system manages its own time boundaries independent of chart bars:
bool clear_state = switch settings.sample_type
SampleType.Ticks => cumulative_series_idx >= settings.number_of_ticks
SampleType.Time => cumulative_time_delta >= settings.number_of_seconds
This dual-clock system synchronizes two time domains:
Pine's execution clock (bar-by-bar processing)
The custom timeframe clock (tick or time-based)
The library carefully handles temporal discontinuities, ensuring candle formation remains accurate despite irregular tick arrival or market gaps.
Advanced Usage Techniques
1. Creating Custom Indicators with Real-Time Candles
To develop indicators that process real-time data within the current bar:
// Get real-time candles for your data
Candle rsi_candles = candle_array(ta.rsi(close, 14))
// Calculate indicator values based on candle properties
float signal = ta.ema(rsi_candles.first().source(Source.Close), 9)
// Detect patterns that occur within the bar
bool divergence = close > close and rsi_candles.first().Close < rsi_candles.get(1).Close
2. Working with Custom Timeframes and Plotting
For maximum flexibility when visualizing custom timeframe data:
// Create custom timeframe candles
CandleCTF volume_candles = ctf_candles_array(
source = volume,
candle_type = CandleType.candlestick,
sample_type = SampleType.Time,
number_of_seconds = 60
)
// Convert specific candle properties to float arrays
float volume_closes = volume_candles.candle_ctf_to_float(Source.Close)
// Calculate derived values
float volume_ema = volume_candles.ctf_ema(14)
// Create custom visualization
volume_candles.draw_ctf_candles_time()
volume_ema.draw_ctf_line_time(line_color = color.orange)
3. Creating Hybrid Timeframe Analysis
One powerful application is comparing indicators across multiple timeframes:
// Standard chart timeframe RSI
float chart_rsi = ta.rsi(close, 14)
// Custom 5-second timeframe RSI
CandleCTF ctf_candles = ctf_candles_array(
source = close,
candle_type = CandleType.candlestick,
sample_type = SampleType.Time,
number_of_seconds = 5
)
float fast_rsi_array = ctf_candles.candle_ctf_to_float(Source.Close)
float fast_rsi = fast_rsi_array.first()
// Generate signals based on divergence between timeframes
bool entry_signal = chart_rsi < 30 and fast_rsi > fast_rsi_array.get(1)
Final Notes
This library represents an advanced implementation of real-time data processing within Pine Script's constraints. By creating a reactive programming framework for handling continuous data streams, it enables sophisticated analysis typically only available in dedicated trading platforms.
The design principles employedโincluding state management, temporal processing, and object-oriented architectureโcan serve as patterns for other advanced Pine Script development beyond this specific application.
------------------------
Library "real_time_candles"
A comprehensive library for creating real-time candles with customizable timeframes and sampling methods.
Supports both chart-time and custom-time candles with options for candlestick and Heikin-Ashi visualization.
Allows for tick-based or time-based sampling with moving average overlay capabilities.
get_tick(source, na_replace)
โโCaptures the current price as a tick data point
โโParameters:
โโโโ source (float) : Optional - Price source to sample (defaults to close)
โโโโ na_replace (float) : Optional - Value to use when source is na
โโReturns: TickData structure containing price, time since last update, and sequential index
candle_array(source, candle_type, sync_start, bullish_color, bearish_color)
โโCreates an array of candles based on price updates
โโParameters:
โโโโ source (float) : Optional - Price source to sample (defaults to close)
โโโโ candle_type (simple CandleType) : Optional - Type of candle chart to create (candlestick or Heikin-Ashi)
โโโโ sync_start (simple bool) : Optional - Whether to synchronize with the start of a new bar
โโโโ bullish_color (color) : Optional - Color for bullish candles
โโโโ bearish_color (color) : Optional - Color for bearish candles
โโReturns: Array of Candle objects ordered with most recent at index 0
candle_series(source, candle_type, wait_for_sync, bullish_color, bearish_color)
โโProvides a single candle based on the latest price data
โโParameters:
โโโโ source (float) : Optional - Price source to sample (defaults to close)
โโโโ candle_type (simple CandleType) : Optional - Type of candle chart to create (candlestick or Heikin-Ashi)
โโโโ wait_for_sync (simple bool) : Optional - Whether to wait for a new bar before starting
โโโโ bullish_color (color) : Optional - Color for bullish candles
โโโโ bearish_color (color) : Optional - Color for bearish candles
โโReturns: A single Candle object representing the current state
candle_tuple(source, candle_type, wait_for_sync, bullish_color, bearish_color)
โโProvides candle data as a tuple of OHLC values
โโParameters:
โโโโ source (float) : Optional - Price source to sample (defaults to close)
โโโโ candle_type (simple CandleType) : Optional - Type of candle chart to create (candlestick or Heikin-Ashi)
โโโโ wait_for_sync (simple bool) : Optional - Whether to wait for a new bar before starting
โโโโ bullish_color (color) : Optional - Color for bullish candles
โโโโ bearish_color (color) : Optional - Color for bearish candles
โโReturns: Tuple representing current candle values
method source(self, source, na_replace)
โโExtracts a specific price component from a Candle
โโNamespace types: Candle
โโParameters:
โโโโ self (Candle)
โโโโ source (series Source) : Type of price data to extract (Open, High, Low, Close, or composite values)
โโโโ na_replace (float) : Optional - Value to use when source value is na
โโReturns: The requested price value from the candle
method source(self, source)
โโExtracts a specific price component from a CandleCTF
โโNamespace types: CandleCTF
โโParameters:
โโโโ self (CandleCTF)
โโโโ source (simple Source) : Type of price data to extract (Open, High, Low, Close, or composite values)
โโReturns: The requested price value from the candle as a varip
method candle_ctf_to_float(self, source)
โโConverts a specific price component from each CandleCTF to a float array
โโNamespace types: array
โโParameters:
โโโโ self (array)
โโโโ source (simple Source) : Optional - Type of price data to extract (defaults to Close)
โโReturns: Array of float values extracted from the candles, ordered with most recent at index 0
method ctf_ema(self, ema_period)
โโCalculates an Exponential Moving Average for a CandleCTF array
โโNamespace types: array
โโParameters:
โโโโ self (array)
โโโโ ema_period (simple float) : Period for the EMA calculation
โโReturns: Array of float values representing the EMA of the candle data, ordered with most recent at index 0
method draw_ctf_candles_time(self, sample_type, number_of_ticks, number_of_seconds, timezone)
โโRenders custom timeframe candles using bar time coordinates
โโNamespace types: array
โโParameters:
โโโโ self (array)
โโโโ sample_type (simple SampleType) : Optional - Method for sampling data (Time or Ticks), used for tooltips
โโโโ number_of_ticks (simple int) : Optional - Number of ticks per candle (used when sample_type is Ticks), used for tooltips
โโโโ number_of_seconds (simple float) : Optional - Time duration per candle in seconds (used when sample_type is Time), used for tooltips
โโโโ timezone (simple int) : Optional - Timezone offset from UTC (-12 to +12), used for tooltips
โโReturns: void - Renders candles on the chart using time-based x-coordinates
method draw_ctf_candles_index(self, sample_type, number_of_ticks, number_of_seconds, timezone)
โโRenders custom timeframe candles using bar index coordinates
โโNamespace types: array
โโParameters:
โโโโ self (array)
โโโโ sample_type (simple SampleType) : Optional - Method for sampling data (Time or Ticks), used for tooltips
โโโโ number_of_ticks (simple int) : Optional - Number of ticks per candle (used when sample_type is Ticks), used for tooltips
โโโโ number_of_seconds (simple float) : Optional - Time duration per candle in seconds (used when sample_type is Time), used for tooltips
โโโโ timezone (simple int) : Optional - Timezone offset from UTC (-12 to +12), used for tooltips
โโReturns: void - Renders candles on the chart using index-based x-coordinates
method draw_ctf_line_time(self, source, line_size, line_color)
โโRenders a line representing a price component from the candles using time coordinates
โโNamespace types: array
โโParameters:
โโโโ self (array)
โโโโ source (simple Source) : Optional - Type of price data to extract (defaults to Close)
โโโโ line_size (simple int) : Optional - Width of the line
โโโโ line_color (simple color) : Optional - Color of the line
โโReturns: void - Renders a connected line on the chart using time-based x-coordinates
method draw_ctf_line_time(self, line_size, line_color)
โโRenders a line from a varip float array using time coordinates
โโNamespace types: array
โโParameters:
โโโโ self (array)
โโโโ line_size (simple int) : Optional - Width of the line, defaults to 2
โโโโ line_color (simple color) : Optional - Color of the line
โโReturns: void - Renders a connected line on the chart using time-based x-coordinates
method draw_ctf_line_index(self, source, line_size, line_color)
โโRenders a line representing a price component from the candles using index coordinates
โโNamespace types: array
โโParameters:
โโโโ self (array)
โโโโ source (simple Source) : Optional - Type of price data to extract (defaults to Close)
โโโโ line_size (simple int) : Optional - Width of the line
โโโโ line_color (simple color) : Optional - Color of the line
โโReturns: void - Renders a connected line on the chart using index-based x-coordinates
method draw_ctf_line_index(self, line_size, line_color)
โโRenders a line from a varip float array using index coordinates
โโNamespace types: array
โโParameters:
โโโโ self (array)
โโโโ line_size (simple int) : Optional - Width of the line, defaults to 2
โโโโ line_color (simple color) : Optional - Color of the line
โโReturns: void - Renders a connected line on the chart using index-based x-coordinates
plot_ctf_tick_candles(source, candle_type, number_of_ticks, timezone, tied_open, ema_period, bullish_color, bearish_color, line_width, ema_color, use_time_indexing)
โโPlots tick-based candles with moving average
โโParameters:
โโโโ source (float) : Input price source to sample
โโโโ candle_type (simple CandleType) : Type of candle chart to display
โโโโ number_of_ticks (simple int) : Number of ticks per candle
โโโโ timezone (simple int) : Timezone offset from UTC (-12 to +12)
โโโโ tied_open (simple bool) : Whether to tie open price to close of previous candle
โโโโ ema_period (simple float) : Period for the exponential moving average
โโโโ bullish_color (color) : Optional - Color for bullish candles
โโโโ bearish_color (color) : Optional - Color for bearish candles
โโโโ line_width (simple int) : Optional - Width of the moving average line, defaults to 2
โโโโ ema_color (color) : Optional - Color of the moving average line
โโโโ use_time_indexing (simple bool) : Optional - When true the function will plot with xloc.time, when false it will plot using xloc.bar_index
โโReturns: void - Creates visual candle chart with EMA overlay
plot_ctf_tick_candles(source, candle_type, number_of_ticks, timezone, tied_open, bullish_color, bearish_color, use_time_indexing)
โโPlots tick-based candles without moving average
โโParameters:
โโโโ source (float) : Input price source to sample
โโโโ candle_type (simple CandleType) : Type of candle chart to display
โโโโ number_of_ticks (simple int) : Number of ticks per candle
โโโโ timezone (simple int) : Timezone offset from UTC (-12 to +12)
โโโโ tied_open (simple bool) : Whether to tie open price to close of previous candle
โโโโ bullish_color (color) : Optional - Color for bullish candles
โโโโ bearish_color (color) : Optional - Color for bearish candles
โโโโ use_time_indexing (simple bool) : Optional - When true the function will plot with xloc.time, when false it will plot using xloc.bar_index
โโReturns: void - Creates visual candle chart without moving average
plot_ctf_time_candles(source, candle_type, number_of_seconds, timezone, tied_open, ema_period, bullish_color, bearish_color, line_width, ema_color, use_time_indexing)
โโPlots time-based candles with moving average
โโParameters:
โโโโ source (float) : Input price source to sample
โโโโ candle_type (simple CandleType) : Type of candle chart to display
โโโโ number_of_seconds (simple float) : Time duration per candle in seconds
โโโโ timezone (simple int) : Timezone offset from UTC (-12 to +12)
โโโโ tied_open (simple bool) : Whether to tie open price to close of previous candle
โโโโ ema_period (simple float) : Period for the exponential moving average
โโโโ bullish_color (color) : Optional - Color for bullish candles
โโโโ bearish_color (color) : Optional - Color for bearish candles
โโโโ line_width (simple int) : Optional - Width of the moving average line, defaults to 2
โโโโ ema_color (color) : Optional - Color of the moving average line
โโโโ use_time_indexing (simple bool) : Optional - When true the function will plot with xloc.time, when false it will plot using xloc.bar_index
โโReturns: void - Creates visual candle chart with EMA overlay
plot_ctf_time_candles(source, candle_type, number_of_seconds, timezone, tied_open, bullish_color, bearish_color, use_time_indexing)
โโPlots time-based candles without moving average
โโParameters:
โโโโ source (float) : Input price source to sample
โโโโ candle_type (simple CandleType) : Type of candle chart to display
โโโโ number_of_seconds (simple float) : Time duration per candle in seconds
โโโโ timezone (simple int) : Timezone offset from UTC (-12 to +12)
โโโโ tied_open (simple bool) : Whether to tie open price to close of previous candle
โโโโ bullish_color (color) : Optional - Color for bullish candles
โโโโ bearish_color (color) : Optional - Color for bearish candles
โโโโ use_time_indexing (simple bool) : Optional - When true the function will plot with xloc.time, when false it will plot using xloc.bar_index
โโReturns: void - Creates visual candle chart without moving average
plot_ctf_candles(source, candle_type, sample_type, number_of_ticks, number_of_seconds, timezone, tied_open, ema_period, bullish_color, bearish_color, enable_ema, line_width, ema_color, use_time_indexing)
โโUnified function for plotting candles with comprehensive options
โโParameters:
โโโโ source (float) : Input price source to sample
โโโโ candle_type (simple CandleType) : Optional - Type of candle chart to display
โโโโ sample_type (simple SampleType) : Optional - Method for sampling data (Time or Ticks)
โโโโ number_of_ticks (simple int) : Optional - Number of ticks per candle (used when sample_type is Ticks)
โโโโ number_of_seconds (simple float) : Optional - Time duration per candle in seconds (used when sample_type is Time)
โโโโ timezone (simple int) : Optional - Timezone offset from UTC (-12 to +12)
โโโโ tied_open (simple bool) : Optional - Whether to tie open price to close of previous candle
โโโโ ema_period (simple float) : Optional - Period for the exponential moving average
โโโโ bullish_color (color) : Optional - Color for bullish candles
โโโโ bearish_color (color) : Optional - Color for bearish candles
โโโโ enable_ema (bool) : Optional - Whether to display the EMA overlay
โโโโ line_width (simple int) : Optional - Width of the moving average line, defaults to 2
โโโโ ema_color (color) : Optional - Color of the moving average line
โโโโ use_time_indexing (simple bool) : Optional - When true the function will plot with xloc.time, when false it will plot using xloc.bar_index
โโReturns: void - Creates visual candle chart with optional EMA overlay
ctf_candles_array(source, candle_type, sample_type, number_of_ticks, number_of_seconds, tied_open, bullish_color, bearish_color)
โโCreates an array of custom timeframe candles without rendering them
โโParameters:
โโโโ source (float) : Input price source to sample
โโโโ candle_type (simple CandleType) : Type of candle chart to create (candlestick or Heikin-Ashi)
โโโโ sample_type (simple SampleType) : Method for sampling data (Time or Ticks)
โโโโ number_of_ticks (simple int) : Optional - Number of ticks per candle (used when sample_type is Ticks)
โโโโ number_of_seconds (simple float) : Optional - Time duration per candle in seconds (used when sample_type is Time)
โโโโ tied_open (simple bool) : Optional - Whether to tie open price to close of previous candle
โโโโ bullish_color (color) : Optional - Color for bullish candles
โโโโ bearish_color (color) : Optional - Color for bearish candles
โโReturns: Array of CandleCTF objects ordered with most recent at index 0
Candle
โโStructure representing a complete candle with price data and display properties
โโFields:
โโโโ Open (series float) : Opening price of the candle
โโโโ High (series float) : Highest price of the candle
โโโโ Low (series float) : Lowest price of the candle
โโโโ Close (series float) : Closing price of the candle
โโโโ polarity (series bool) : Boolean indicating if candle is bullish (true) or bearish (false)
โโโโ series_index (series int) : Sequential index identifying the candle in the series
โโโโ candle_color (series color) : Color to use when rendering the candle
โโโโ ready (series bool) : Boolean indicating if candle data is valid and ready for use
TickData
โโStructure for storing individual price updates
โโFields:
โโโโ price (series float) : The price value at this tick
โโโโ time_delta (series float) : Time elapsed since the previous tick in milliseconds
โโโโ series_index (series int) : Sequential index identifying this tick
CandleCTF
โโStructure representing a custom timeframe candle with additional time metadata
โโFields:
โโโโ Open (series float) : Opening price of the candle
โโโโ High (series float) : Highest price of the candle
โโโโ Low (series float) : Lowest price of the candle
โโโโ Close (series float) : Closing price of the candle
โโโโ polarity (series bool) : Boolean indicating if candle is bullish (true) or bearish (false)
โโโโ series_index (series int) : Sequential index identifying the candle in the series
โโโโ open_time (series int) : Timestamp marking when the candle was opened (in Unix time)
โโโโ time_delta (series float) : Duration of the candle in milliseconds
โโโโ candle_color (series color) : Color to use when rendering the candle
footprint_typeLibrary "footprint_type"
Contains all types for calculating and rendering footprints
Inputs
โโInputs objects
โโFields:
โโโโ inbalance_percent (series int) : percentage coefficient to determine the Imbalance of price levels
โโโโ stacked_input (series int) : minimum number of consecutive Imbalance levels required to draw extended lines
โโโโ show_summary_footprint (series bool) : bool input for show summary footprint
โโโโ procent_volume_area (series int) : definition size Value area
โโโโ show_vah (series bool) : bool input for show VAH
โโโโ show_poc (series bool) : bool input for show POC
โโโโ show_val (series bool) : bool input for show VAL
โโโโ color_vah (series color) : color VAH line
โโโโ color_poc (series color) : color POC line
โโโโ color_val (series color) : color VAL line
โโโโ show_volume_profile (series bool)
โโโโ new_imbalance_cond (series bool) : bool input for setup alert on new imbalance buy and sell
โโโโ new_imbalance_line_cond (series bool) : bool input for setup alert on new imbalance line buy and sell
โโโโ stop_past_imbalance_line_cond (series bool) : bool input for setup alert on stop past imbalance line buy and sell
Constants
โโConstants all Constants objects
โโFields:
โโโโ imbalance_high_char (series string) : char for printing buy imbalance
โโโโ imbalance_low_char (series string) : char for printing sell imbalance
โโโโ color_title_sell (series color) : color for footprint sell
โโโโ color_title_buy (series color) : color for footprint buy
โโโโ color_line_sell (series color) : color for sell line
โโโโ color_line_buy (series color) : color for buy line
โโโโ color_title_none (series color) : color None
Calculation_data
โโCalculation_data data for calculating
โโFields:
โโโโ detail_open (array) : array open from calculation timeframe
โโโโ detail_high (array) : array high from calculation timeframe
โโโโ detail_low (array) : array low from calculation timeframe
โโโโ detail_close (array) : array close from calculation timeframe
โโโโ detail_vol (array) : array volume from calculation timeframe
โโโโ previos_detail_close (array) : array close from calculation timeframe
โโโโ isBuyVolume (series bool) : attribute previosly bar buy or sell
Footprint_row
โโFootprint_row objects one footprint row
โโFields:
โโโโ price (series float) : row price
โโโโ buy_vol (series float) : buy volume
โโโโ sell_vol (series float) : sell volume
โโโโ imbalance_buy (series bool) : attribute buy inbalance
โโโโ imbalance_sell (series bool) : attribute sell imbalance
โโโโ buy_vol_box (series box) : for ptinting buy volume
โโโโ sell_vol_box (series box) : for printing sell volume
โโโโ buy_vp_box (series box) : for ptinting volume profile buy
โโโโ sell_vp_box (series box) : for ptinting volume profile sell
โโโโ row_line (series label) : for ptinting row price
โโโโ empty (series bool) : = true attribute row with zero volume buy and zero volume sell
Value_area
โโValue_area objects for calculating and printing Value area
โโFields:
โโโโ vah_price (series float) : VAH price
โโโโ poc_price (series float) : POC price
โโโโ val_price (series float) : VAL price
โโโโ vah_label (series label) : label for VAH
โโโโ poc_label (series label) : label for POC
โโโโ val_label (series label) : label for VAL
โโโโ vah_line (series line) : line for VAH
โโโโ poc_level (series line) : line for POC
โโโโ val_line (series line) : line for VAL
Imbalance_line_var_object
โโImbalance_line_var_object var objects printing and calculation imbalance line
โโFields:
โโโโ cum_buy_line (array) : line array for saving all history buy imbalance line
โโโโ cum_sell_line (array) : line array for saving all history sell imbalance line
Imbalance_line
โโImbalance_line objects printing and calculation imbalance line
โโFields:
โโโโ buy_price_line (array) : float array for saving buy imbalance price level
โโโโ sell_price_line (array) : float array for saving sell imbalance price level
โโโโ var_imba_line (Imbalance_line_var_object) : var objects this type
Footprint_info_var_object
โโFootprint_info_var_object var objects for info printing
โโFields:
โโโโ cum_delta (series float) : var delta volume
โโโโ cum_total (series float) : var total volume
โโโโ cum_buy_vol (series float) : var buy volume
โโโโ cum_sell_vol (series float) : var sell volume
โโโโ cum_info (series table) : table for ptinting
Footprint_info
โโFootprint_info objects for info printing
โโFields:
โโโโ var_info (Footprint_info_var_object) : var objects this type
โโโโ total (series label) : total volume
โโโโ delta (series label) : delta volume
โโโโ summary_label (series label) : label for ptinting
Footprint_bar
โโFootprint_bar all objects one bar with footprint
โโFields:
โโโโ foot_rows (array) : objects one row footprint
โโโโ val_area (Value_area) : objects Value area
โโโโ imba_line (Imbalance_line) : objects imbalance line
โโโโ info (Footprint_info) : objects info - table,label and their variable
โโโโ row_size (series float) : size rows
โโโโ total_vol (series float) : total volume one footprint bar
โโโโ foot_buy_vol (series float) : buy volume one footprint bar
โโโโ foot_sell_vol (series float) : sell volume one footprint bar
โโโโ foot_max_price_vol (map) : map with one value - price row with max volume buy + sell
โโโโ calc_data (Calculation_data) : objects with detail data from calculation resolution
Support_objects
โโSupport_objects support object for footprint calculation
โโFields:
โโโโ consts (Constants) : all consts objects
โโโโ inp (Inputs) : all input objects
โโโโ bar_index_show_condition (series bool) : calculation bool value for show all objects footprint
โโโโ row_line_color (series color) : calculation value - color for row price
.srb suiteThe essential suite Indicator.
that are well integrated to ensure visibility of essential items for trading.
it is very cumbersome to put symbol in the Tradingview chart and combine essential individual indicators one by one.
Moreover even with such a combination, the chart is messy and visibility is not good.
This is because each indicator is not designed with the others in mind.
This suite was developed as a composite-solution to that situation, and will make you happy.
designed to work in the same pane with open-source indicator by default.
Recommended visual order ; Back = .srb suite, Front = .srb suite vol & info
individually turn on/off only what you need on the screen.
BTC-agg. Volume
4 BTC-spot & 4 BTC-PERP volume aggregated.
It might helps you don't miss out on important volume flows.
Weighted to spot trading volume when using PERP+spot volume .
If enabled, BTC-agg.Vol automatically applied when selecting BTC-pair.
--> This is used in calculations involving volumes, such as VWAP.
Moving Average
1 x JMA trend ribbon ; Accurately follow short-term trend changes.
3 x EMA ribbon ; zone , not the line.
MA extension line ; It provide high visibility to recognize the direction of the MA.
SPECIAL TOOLS
VWAP with Standard Deviation Bands
VWAP ruler
BB regular (Dev. 2.0, 2.5)
BB Extented (Dev. 2.5, 3.0, 3.5)
Fixed Range Volume Profile ; steamlined one, performace tuned & update.
SPECIAL TOOLS - Auto Fibonacci Retracement - New GUI
'built-in auto FBR ' has been re-born
It shows - retracement Max top/ min bottom ; for higher visibility
It shows - current retracement position ; for higher visibility
The display of the Fib position that exceeds the regular range is auto-determined according to the price.
tradingview | chart setting > Appearance > Top margin 0%, Bottom margin 0% for optimized screen usage
tradingview | chart setting > Appearance > Right margin 57
.srb suite vol & info --> Visual Order > Bring to Front
.srb suite vol & info --> Pin to scale > No scale (Full-screen)
Visual order ; Back = .srb suite, Front = .srb suite vol & info
1. Fib.Retracement core is from tradingview built-in FBR ---> upgrade new-type GUI, and performance tuned.
2. Fixed-range volume-profile core is from the open-source one ---> some update & perf.tuned.
---------------------------------------------------------------------------------------------------------------------------------------
if you have any questions freely contact to me by message on tradingview.
but please understand that responses may be quite late.
Special thanks to all of contributors of community.
The script may be freely distributed under the MIT license.
VPoC per barThis study prints the current bar VPoC as an horizontal line.
It's aimed originally at BTCUSDT pair and 15m timeframe.
HOW IT WORKS
Zoom In mode: This is the default mode.
The study zooms in into the latest 15 1-minute bar candles in order to calculate the 15 minute candle VPoC.
Zoom Out mode: The VPoC from the last n bars from the current timeframe that match desired timeframe is shown on each bar.
In either case you are recommended to click on the '...' button associated to this study
and select 'Visual Order. Bring to Front.' so that it's properly shown in your chart.
HOW IT WORKS - Zoom In mode
Make sure that '(VP) Zoom into the VP timeframe' setting is set to true.
Choose the zoomed in timeframe where to calculate VPoC from thanks to the '(VP) Zoomed timeframe {1 minute}' setting.
Change '(VP) Zoomed in timeframe bars per current timeframe bar {15}' to its appropiated value. You just need to divide the current timeframe minutes per the zoomed in timeframe minutes per bar. E.g. If you are in 60 minute timeframe and you want to zoom in into 5 minute timeframe: 60 / 5 = 12 . You will write 12 here.
HOW IT WORKS - Zoom Out mode
Make sure that '(VP) Zoom into the VP timeframe' setting is set to false.
If you are using the Zoom out mode you might want to set '(VP) Print VPoC price as discrete lines {True}' to false.
Either choose the zoommed out timeframe where to calculate VPoC from thanks to the '(VP) Zoomed timeframe {1 minute}' setting or turn on the '(VP) Use number of bars (not VP timeframe)' setting in order to use '(VP) Number of bars {100}' as a custom number of bars.
WARNING - Zoom In mode last bar
The way that PineScript handles security function in last bar might result on the last bar not being accurate enough.
SETTINGS
__ SETTINGS - Volume Profile
(VP) Zoomed timeframe {1 minute}: Timeframe in which to zoom in or zoom out to calculate an accurate VPoC for the current timeframe.
(VP) Zoomed in timeframe bars per current timeframe bar {15}: Check 'HOW IT WORKS - Zoom In mode' above. Note : It is only used in 'Zoom in' mode.
(VP) Number of bars {100}: If 'Use number of bars (not VP timeframe)' is turned on this setting is used to calculate session VPoC. Note : It is only used in 'Zoom out' mode.
(VP) Price levels {24}: Price levels for calculating VPoC.
__ SETTINGS - MAIN TURN ON/OFF OPTIONS
(VP) Print VPoC price {True}: Show VPoC price
(VP) Zoom into the VP timeframe: When set to true the VPoC is calculated by zooming into the lower timeframe. When set to false a higher timeframe (or number of bars) is used.
(VP) Realtime Zoom in (Beta): Enable real time zoom for the last bar. It's beta because it would only work with zoomed in timeframe under 60 minutes. And when ratio between zoomout and zoomin is less than 60. Note : It is only used in 'Zoom in' mode.
(VP) Use number of bars (not VP timeframe): Uses 'Number of bars {100}' setting instead of 'Volume Profile timeframe' setting for calculating session VPoC. Note : It is only used in 'Zoom out' mode.
(VP) Print VPoC price as discrete lines {True}: When set to true the VPoC is shown as an small line in the center of each bar. When set to the false the VPoC line is printed as a normal line.
__ SETTINGS - EXTRA
(VP) VPoC color: Change the VPoC color
(VP) VPoC line width {1}: Change VPoC line width (in pixels).
(VP) Use number of bars (not VP timeframe): Uses 'Number of bars {100}' setting instead of 'Volume Profile timeframe' setting for calculating session VPoC. Note : It is only used in 'Zoom out' mode.
(VP) Print VPoC price as discrete lines {True}: When set to true the VPoC is shown as an small line in the center of each bar. When set to the false the VPoC line is printed as a normal line.
CREDITS
I have reused and adapted some code from
"Poor man's volume profile" study
which it's from TradingView IldarAkhmetgaleev user.
VHX EMA 135/315๐ EMA 135/315 Cross Strategy โ Your Trend Compass with Smart Confirmations
๐ Core Idea
The EMA 135/315 Cross strategy is a trend-following system.
It tracks two moving averages:
EMA 135 โ the โfastโ line that reacts to short-term price moves
EMA 315 โ the โslowโ line that reacts to the bigger trend
When the fast EMA crosses above the slow EMA โ market momentum is turning up โ BUY signal ๐ข
When the fast EMA crosses below the slow EMA โ momentum is turning down โ SELL signal ๐ด
This gives you a clear entry trigger โ no guessing, no overcomplication.
โจ On Your Chart
BUY/SELL Arrows
๐ข Green arrow = bullish cross โ trend turning up
๐ด Red arrow = bearish cross โ trend turning down
Trend Info Panel (Top Left)
Current Trend: BUY / SELL / Neutral
Last Cross: how many bars ago it happened
EMA Gap in %: measures the strength of the trend
Status: โApproachingโ if EMAs are getting close โ possible cross soon
Automatic TP/SL Levels
๐ TP line (+2% from entry)
๐ SL line (โ0.5% from entry)
Saves time โ you instantly see your target and protection
EMA Distance Meter
Big % gap = strong trend momentum ๐
Small % gap = weak or sideways market โ ๏ธ
Real-Time Alerts
You get notified when a cross happens, even if youโre away from the screen
๐ง The Logic Behind It
The EMA 135 reacts faster โ it reflects short-term momentum
The EMA 315 moves slower โ it reflects the main trend
When the fast EMA overtakes the slow EMA: short-term strength now aligns with the long-term trend โ higher probability of a sustained move
The gap % tells you how strong the alignment is โ large gap = cleaner moves, small gap = market in transition
โApproachingโ status warns that the EMAs are converging, which often happens before a reversal
๐ Boosting the Strategy with Volume Analysis
The EMA cross is a strong trigger, but volume confirms the quality of the move:
High Volume + Cross โ more reliable signal, as strong market participation is pushing the trend
Low Volume + Cross โ caution, the move might be weak or a false breakout
๐ก Tip:
Check the volume histogram or a volume-based indicator (e.g., Volume Profile, OBV).
On a BUY signal: volume should spike above the recent average.
On a SELL signal: watch for strong selling volume bars.
๐ Adding Support & Resistance for Precision
Support and resistance levels help filter out bad trades and optimize entries:
Best BUY setups:
EMA 135 crosses above EMA 315 near a known support zone
Bonus if volume confirms the move
Avoid buying directly into a strong resistance
Best SELL setups:
EMA 135 crosses below EMA 315 near a known resistance zone
Bonus if selling volume is strong
Avoid selling directly into a major support
๐ก Use tools like horizontal lines, previous highs/lows, and Volume Profile nodes to spot these zones.
๐ Best Usage Practices
Timeframes
Lower timeframes (1mโ5m) โ more signals, but more noise โ best for scalping with extra filters
Always Combine With Confirmation
EMA Cross = Trigger
Volume spike = Confirmation
S/R zone in your favor = High-probability setup
Manage Risk
Start with the built-in TP/SL
Adjust SL if volatility is higher than usual
Consider trailing stop once price moves in your favor
Avoid Sideways Markets
If EMA gap % is very small and crosses happen often โ stand aside until a clear direction forms
Use Alerts
Set alerts for BUY & SELL crosses so you never miss a setup
In short:
This isnโt just an EMA cross indicator โ itโs a trend system with built-in risk management, strength measurement, and pre-trade preparation. Combine it with volume confirmation and smart use of support/resistance, and you turn a simple signal into a high-probability trading edge.
Z-Score Volume with CVD Clustering Script Title:
Z-Score Volume with CVD Clustering & NY VWAP
๐ Description:
This indicator combines statistical volume analysis with order flow confirmation to detect high-probability trade zones and volume-based divergences.
๐ Components:
Z-Score of Volume: Identifies statistically significant volume surges or drops relative to a moving average baseline.
Cumulative Volume Delta (CVD): Gauges net buying vs. selling pressure using high-frequency bid/ask delta.
K-Means Clustering: Applies clustering logic to classify each bar into:
Cluster 2 โ Strong Bullish: Z-Score and CVD both strong
Cluster 1 โ Divergence / Bull Trap: Z-Score high, but weak CVD
Cluster 0 โ Neutral / Noise: No clear alignment
Anchored VWAP (NY Session Open): Confirms market structure and institutional trend bias from 9:30 AM ET forward.
๐ฏ Suggested Applications:
โ
1. Trend Continuation Entries (Add-ons):
Look to add to positions when:
Cluster 2 signal occurs
Price is above the NY session VWAP
Price structure has broken out of prior day high/low or range
โ ๏ธ 2. Divergence Detection (Fade Traps):
Cluster 1 signals a bearish divergence (e.g., high volume but weak CVD).
Especially useful when price is failing to stay above VWAP.
Useful for early exits or reversal setups.
๐ 3. Volume Profile Confirmation:
Combine with fixed or session-based volume profile tools.
Use Z-Score clusters to confirm volume spikes into low-volume nodes (LVNs) or during imbalance transitions.
๐ 4. VWAP Structure Confirmation:
Anchored VWAP acts as a dynamic reference point.
Helps confirm acceptance vs. rejection zones at key institutional levels.
๐ Visuals & Alerts:
Color-coded volume bars show intensity of Z-Score & CVD confluence
CVD Line plots real-time delta bias with green/red coloring
Cluster-based shape markers highlight key bars for actionable signals
Optional: Add alerts for Cluster 2 above VWAP or Cluster 1 below VWAP
โ๏ธ Customization Options:
Adjustable Z-Score length
Custom anchor timeframe for CVD (e.g., 1D or sessions)
Adjustable max lookback depth
Toggle VWAP inclusion
Extendable to include additional filters: RSI, structure break alerts, etc.
๐ง Ideal Use Cases:
NY session intraday traders (ES, NQ, CL, 6E, FX pairs)
Breakout traders wanting order flow confirmation
Mean reversion traders spotting fake moves
Volume-based scalpers looking for edge on short-term order imbalance
Universal Renko Bars by SiddWolfUniversal Renko Bars or UniRenko Bars is an overlay indicator that applies the logic of Renko charting directly onto a standard candlestick chart. It generates a sequence of price-driven bricks, where each new brick is formed only when the price moves a specific amount, regardless of time. This provides a clean, price-action-focused visualization of the market's trend.
WHAT IS UNIVERSAL RENKO BARS?
For years, traders have faced a stark choice: the clean, noise-free world of Renko charts, or the rich, time-based context of Candlesticks. Choosing Renko meant giving up your favorite moving averages, volume profiles, and the fundamental sense of time. Choosing Candlesticks meant enduring the market noise that often clouds true price action.
But what if you didn't have to choose?
Universal Renko Bars is a revolutionary indicator that ends this dilemma. It's not just another charting tool; it's a powerful synthesis that overlays the pure, price-driven logic of Renko bricks directly onto your standard candlestick chart. This hybrid approach gives you the best of both worlds:
โ The Clarity of Renko: By filtering out the insignificant noise of time, Universal Renko reveals the underlying trend with unparalleled clarity. Up trends are clean successions of green bricks; down trends are clear red bricks. No more guesswork.
โ The Context of Candlesticks: Because the Renko logic is an overlay, you retain your time axis, your volume data, and full compatibility with every other time-based indicator in your arsenal (RSI, MACD, Moving Averages, etc.).
The true magic, however, lies in its live, Unconfirmed Renko brick. This semi-transparent box is your window into the current bar's real-time struggle. It grows, shrinks, and changes color with every tick, showing you exactly how close the price is to confirming the trend or forcing a reversal. Itโs no longer a lagging indicator; itโs a live look at the current battle between buyers and sellers.
Universal Renko Bars unifies these two powerful charting methods, transforming your chart into a more intelligent, noise-free, and predictive analytical canvas.
HOW TO USE
To get the most out of Universal Renko Bars, here are a few tips and a full breakdown of the settings.
Initial Setup for the Best Experience
For the cleanest possible view, it's highly recommended that you hide the body of your standard candlesticks, that shows only the skelton of the candle. This allows the Renko bricks to become the primary focus of your chart.
โ Double click on the candles and uncheck the body checkbox.
Settings Breakdown
The indicator is designed to be powerful yet intuitive. The settings are grouped to make customization easy.
First, What is a "Tick"?
Before we dive in, it's important to understand the concept of a "Tick." In Universal Renko, a Tick is not the same as a market tick. It's a fundamental unit of price movement that you define. For example, if you set the Tick Size to $0.50, then a price move of $1.00 is equal to 2 Ticks. This is the core building block for all Renko bricks. Tick size here is dynamically determined by the settings provided in the indicator.
โ Calculation Method (The "Tick Size" Engine)
This section determines the monetary value of a single "Tick."
`Calculation Method` : Choose your preferred engine for defining the Tick Size.
`ATR Based` (Default): The Tick Size becomes dynamic, based on market volatility (Average True Range). Bricks will get larger in volatile markets and smaller in quiet ones. Use the `ATR 14 Multiplier` to control the sensitivity.
`Percentage` : The Tick Size is a simple percentage of the current asset price, controlled by the `Percent Size (%)` input.
`Auto` : The "set it and forget it" mode. The script intelligently calculates a Tick Size based on the asset's price. Use the `Auto Sensitivity` slider to make these automatically calculated bricks thicker (value > 1.0) or thinner (value < 1.0).
โ Parameters (The Core Renko Engine)
This group controls how the bricks are constructed based on the Tick Size.
`Tick Trend` : The number of "Ticks" the price must move in the same direction to print a new continuation brick. A smaller value means bricks form more easily.
`Tick Reversal` : The number of "Ticks" the price must move in the opposite direction to print a new reversal brick. This is typically set higher than `Tick Trend` (e.g., double) to filter out minor pullbacks and market noise.
`Open Offset` : Controls the visual overlap of the bricks. A value of `0` creates gapless bricks that start where the last one ended. A value of `2` (with a `Tick Reversal` of 4) creates the classic 50% overlap look.
โ Visuals (Controlling What You See)
This is where you tailor the chart to your visual preference.
`Show Confirmed Renko` : Toggles the solid-colored, historical bricks. These are finalized and will never change. They represent the confirmed past trend.
`Show Unconfirmed Renko` : This is the most powerful visual feature. It toggles the live, semi-transparent box that represents the developing brick. It shows you exactly where the price is right now in relation to the levels needed to form the next brick.
`Show Max/Min Levels` : Toggles the horizontal "finish lines" on your chart. The green line is the price target for a bullish brick, and the red line is the target for a bearish brick. These are excellent for spotting breakouts.
`Show Info Label` : Toggles the on-chart label that provides key real-time stats:
๐งฑ Bricks: The total count of confirmed bricks.
โณ Live: How many chart bars the current live brick has been forming. These bars forms the Renko bricks that aren't confirmed yet. Live = 0 means the latest renko brick is confirmed.
๐ฒ Tick Size: The current calculated value of a single Tick.
Hover over the label for a tooltip with live RSI(14), MFI(14), and CCI(20) data for additional confirmation.
TRADING STRATEGIES & IDEAS
Universal Renko Bars isn't just a visual tool; it's a foundation for building robust trading strategies.
Trend Confirmation: The primary use is to instantly identify the trend. A series of green bricks indicates a strong uptrend; a series of red bricks indicates a strong downtrend. Use this to filter out trades that go against the primary momentum.
Reversal Spotting: Pay close attention to the Unconfirmed Brick . When a strong trend is in place and the live brick starts to fight against itโchanging color and growing largerโit can be an early warning that a reversal is imminent. Wait for the brick to be confirmed for a higher probability entry.
Breakout Trading: The `Max/Min Levels` are your dynamic breakout zones. A long entry can be considered when the price breaks and closes above the green Max Level, confirming a new bullish brick. A short entry can be taken when price breaks below the red Min Level.
Confluence & Indicator Synergy: This is where Universal Renko truly shines. Overlay a moving average (e.g., 20 EMA). Only take long trades when the green bricks are forming above the EMA. Combine it with RSI or MACD; a bearish reversal brick forming while the RSI shows bearish divergence is a very powerful signal.
A FINAL WORD
Universal Renko Bars was designed to solve a fundamental problem in technical analysis. It brings together the best elements of two powerful methodologies to give you a clearer, more actionable view of the market. By filtering noise while retaining context, it empowers you to make decisions with greater confidence.
Add Universal Renko Bars to your chart today and elevate your analysis. We welcome your feedback and suggestions for future updates!
Follow me to get notified when I publish New Indicator.
~ SiddWolf